跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

  1. 主页
  2. 版块
  3. Odoo 安装指南
  4. 无法备份帐套

无法备份帐套

已定时 已固定 已锁定 已移动 Odoo 安装指南
24 帖子 9 发布者 26.8k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • mrshellyM 离线
    mrshellyM 离线
    mrshelly
    写于 最后由 编辑
    #14

    顶起来.
    今天用 5.0.15 . 按 digitalsatori 的解决方案, 把 misc.py 文件中 的代码 更改为

    <br />...<br /><br />def exec_pg_command_pipe(name, *args):<br />&nbsp; &nbsp; prog = find_pg_tool(name)<br />&nbsp; &nbsp; if not prog:<br />&nbsp; &nbsp; &nbsp; &nbsp; raise Exception(&#039;Couldn\&#039;t find %s&#039; % name)<br /><br />&nbsp; &nbsp; #pop = subprocess.Popen(args, executable=prog, shell=True, bufsize= -1,<br />&nbsp; &nbsp; #&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)<br />&nbsp; &nbsp; pop = subprocess.Popen((prog,) + args, bufsize= -1,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)<br />&nbsp; &nbsp; return (pop.stdin, pop.stdout)<br /><br />def exec_command_pipe(name, *args):<br />&nbsp; &nbsp; prog = find_in_path(name)<br />&nbsp; &nbsp; if not prog:<br />&nbsp; &nbsp; &nbsp; &nbsp; raise Exception(&#039;Couldn\&#039;t find %s&#039; % name)<br /><br />&nbsp; &nbsp; #pop = subprocess.Popen(args, executable=prog, shell=True, bufsize= -1,<br />&nbsp; &nbsp; #&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)<br />&nbsp; &nbsp; pop = subprocess.Popen((prog,) + args, bufsize= -1,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)<br /><br />&nbsp; &nbsp; return (pop.stdin, pop.stdout)<br />...<br />
    



    替换后, 还是备份出错.  digitalsatori 测试过了吗? 或者再深入看一下? 谢谢.

    目前暂时还是使用 os.popen2 解决...

    1 条回复 最后回复
    0
    • mrshellyM 离线
      mrshellyM 离线
      mrshelly
      写于 最后由 编辑
      #15

      好吧. 自己解决了.

      是因为 windows 不支持 close_fds 参数. 所以, 只需要按校长的 改. 并把 close_fds 参数去掉即可.

      既然 校长 B4我了一下... 我也B4校长一下... 哪能不测试就发出来哩... 最起码 os.popen2 的还能用嘛.. 嘿嘿嘿

      <br />...<br /><br />def exec_pg_command_pipe(name, *args):<br />&nbsp; &nbsp; prog = find_pg_tool(name)<br />&nbsp; &nbsp; if not prog:<br />&nbsp; &nbsp; &nbsp; &nbsp; raise Exception(&#039;Couldn\&#039;t find %s&#039; % name)<br /><br />&nbsp; &nbsp; #pop = subprocess.Popen(args, executable=prog, shell=True, bufsize= -1,<br />&nbsp; &nbsp; #&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)<br />&nbsp; &nbsp; pop = subprocess.Popen((prog,) + args, bufsize= -1, stdin=subprocess.PIPE, stdout=subprocess.PIPE)<br />&nbsp; &nbsp; return (pop.stdin, pop.stdout)<br /><br />def exec_command_pipe(name, *args):<br />&nbsp; &nbsp; prog = find_in_path(name)<br />&nbsp; &nbsp; if not prog:<br />&nbsp; &nbsp; &nbsp; &nbsp; raise Exception(&#039;Couldn\&#039;t find %s&#039; % name)<br /><br />&nbsp; &nbsp; #pop = subprocess.Popen(args, executable=prog, shell=True, bufsize= -1,<br />&nbsp; &nbsp; #&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)<br />&nbsp; &nbsp; pop = subprocess.Popen((prog,) + args, bufsize= -1, stdin=subprocess.PIPE, stdout=subprocess.PIPE)<br /><br />&nbsp; &nbsp; return (pop.stdin, pop.stdout)<br />...<br />
      



      5.0.15 server 测试通过...

      1 条回复 最后回复
      0
      • digitalsatoriD 离线
        digitalsatoriD 离线
        digitalsatori 管理员
        写于 最后由 编辑
        #16

        B4的有理,偶也B4一下校长。 😄 多谢Shelly同学

        【上海先安科技】(tony AT openerp.cn)

        1 条回复 最后回复
        0
        • X 离线
          X 离线
          xtjie
          写于 最后由 编辑
          #17

          请问在windows下可以修改吗?如果能修改,改哪儿.

          1 条回复 最后回复
          0
          • mrshellyM 离线
            mrshellyM 离线
            mrshelly
            写于 最后由 编辑
            #18

            [quote author=xtjie link=topic=2244.msg7385#msg7385 date=1295247745]
            请问在windows下可以修改吗?如果能修改,改哪儿.
            [/quote]


            我说的就是 windows 下的.

            只需要修改 windows openerp server 文件夹下的  library.zip 文件里对应的文件 就行了...

            1 条回复 最后回复
            0
            • X 离线
              X 离线
              xtjie
              写于 最后由 编辑
              #19

              library.zip 里的文件都是 .pyo编译过的文件,我在源文件里修改完,用python -O 编译出现缺少模块的编译错误,总不能再生成一个windows的 server 安装包. 或者把misc.py 修改完直接放在library.zip里,是否可行.

              1 条回复 最后回复
              0
              • mrshellyM 离线
                mrshellyM 离线
                mrshelly
                写于 最后由 编辑
                #20

                [quote author=xtjie link=topic=2244.msg7387#msg7387 date=1295311398]
                library.zip 里的文件都是 .pyo编译过的文件,我在源文件里修改完,用python -O 编译出现缺少模块的编译错误,总不能再生成一个windows的 server 安装包. 或者把misc.py 修改完直接放在library.zip里,是否可行.
                [/quote]

                try it .


                注意 优先级.

                当 .pyc .pyo 文件存在时. python 是不会去理会  .py 文件的.

                1 条回复 最后回复
                0
                • X 离线
                  X 离线
                  xtjie
                  写于 最后由 编辑
                  #21

                  windows只能是把整个生成包的环境安装后,修改完misc.py后,编译misc.py,否则不能用.这就是在linux下和windows下玩的区别.linux下修改完,一存新可以了.windows下不行.

                  1 条回复 最后回复
                  0
                  • mrshellyM 离线
                    mrshellyM 离线
                    mrshelly
                    写于 最后由 编辑
                    #22

                    我就瞧这个贴子, 啥话都不说.


                    或者把misc.py 修改完直接放在library.zip里,是否可行.

                    try it .


                    注意 优先级.

                    当 .pyc .pyo 文件存在时. python 是不会去理会  .py 文件的.

                    如果你有仔细看回贴.. 应该不难找出解决办法.

                    1 条回复 最后回复
                    0
                    • X 离线
                      X 离线
                      xtjie
                      写于 最后由 编辑
                      #23

                      我试过了,删除misc.pyo,把misc.py放在library.zip 中,不行.

                      1 条回复 最后回复
                      0
                      • mrshellyM 离线
                        mrshellyM 离线
                        mrshelly
                        写于 最后由 编辑
                        #24

                        好吧.. 告诉你方法...

                        用 winrar 打开 library.zip 不要关.

                        直接在 winrar 界面中, 按 del 键删除 .pyo 文件.然后再把你修改后的 .py 文件拖进 winrar 窗口. 即可.

                        PS: 要重启 server 的. 

                        1 条回复 最后回复
                        0

                        • 登录

                        • 没有帐号? 注册

                        • 登录或注册以进行搜索。
                        • 第一个帖子
                          最后一个帖子
                        0
                        • 版块
                        • 标签
                        • 热门
                        • 用户
                        • 群组