跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • 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. 供應商資料EXCEL檔匯入

供應商資料EXCEL檔匯入

已定时 已固定 已锁定 已移动 Odoo 新手求助
4 帖子 3 发布者 4.0k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • K 离线
    K 离线
    klm2242
    写于 最后由 编辑
    #1

    請教一下,我目前做了一個測試,想要把供商EXCEL檔,直接匯入到OE內

    請問,可以這樣做嗎??

    若可以的話,要怎麼做才能將EXCEL的資料匯入OE內呢?EXCEL格式要怎麼弄?

    再麻煩各位若知道的話,將操作流程給我測試一下了,謝謝! 🙂

    1 条回复 最后回复
    0
    • 阿 离线
      阿 离线
      阿宽
      写于 最后由 编辑
      #2

      好像是导入csv ,你先把xls保存为csv格式,然后再导入呢。

      1 条回复 最后回复
      0
      • D 离线
        D 离线
        d_yang
        写于 最后由 编辑
        #3

        我只贴导入部分的代码,希望对你有帮助。

        1. 定义一个wizard

        <br />class cash_bill_import(osv.osv_memory):<br />&nbsp; &nbsp; _name = &quot;fg_account.cash_bill.import.wizard&quot;<br />&nbsp; &nbsp; _description = &quot;导入现金账单明细&quot;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; _columns = {<br />&nbsp; &nbsp; &nbsp; &nbsp; &#039;excel&#039;: fields.binary(&#039;excel文件&#039;, filters=&#039;*.xls&#039;),<br />&nbsp; &nbsp; }<br /><br /><br />&nbsp; &nbsp; def import_bill(self, cr, uid, ids, context=None):<br />&nbsp; &nbsp; &nbsp; &nbsp; result = {&#039;type&#039;: &#039;ir.actions.act_window_close&#039;}<br />&nbsp; &nbsp; &nbsp; &nbsp; for wiz in self.browse(cr,uid,ids):<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if not wiz.excel: continue<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; excel = xlrd.open_workbook(file_contents=base64.decodestring(wiz.excel))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sh = excel.sheet_by_index(0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for rx in range(sh.nrows):<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; date_s = sh.cell(rx, 0).value<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cash_in = sh.cell(rx, 3).value<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .....<br /><br />
        



        1 条回复 最后回复
        0

        • 登录

        • 没有帐号? 注册

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