Skip to content
  • Categories
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • 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

  • Default (Flatly)
  • No Skin
Collapse

Odoo 中文社区

  1. Home
  2. Categories
  3. Odoo 开发与实施交流
  4. 如何在销售订单行增加几个字段odoo10?

如何在销售订单行增加几个字段odoo10?

Scheduled Pinned Locked Moved Odoo 开发与实施交流
6 Posts 2 Posters 5.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I
    I
    info521
    wrote on last edited by
    #1

    如何在销售订单行增加几个字段odoo10?

    定义了字段(修改)
    class SaleOrderLine(models.Model):
        _name = "sale.order.line"
        _inherit = 'sale.order.line'

    继承了订单行视图
        <!-- 添加到订单行列表视图 -->
            <record id="sale.view_order_line_tree_inherit_return" model="ir.ui.view">
                <field name="name">sale.order.line.tree.inherit.return</field>
                <field name="model">sale.order.line</field>
                <field name="inherit_id" ref="sale.view_order_line_tree"/>
                <field name="arch" type="xml">
    <field name="qty_to_invoice" position="after">
    <field name="quantity_return"/>

    安装模块后,在订单行不显示定义的字段,

    请问哪里没做对?

    1 Reply Last reply
    0
    • Y
      Y
      yijingchang
      wrote on last edited by
      #2

      貌似你的字段的代码加到了sale.order类中,但是界面是加到了sale.order.line类中

      1 Reply Last reply
      0
      • I
        I
        info521
        wrote on last edited by
        #3

        定义类正确 ,发帖错误了
        class SaleOrderLine(models.Model):
            _name = "sale.order.line"
            _inherit = 'sale.order.line'

        1 Reply Last reply
        0
        • I
          I
          info521
          wrote on last edited by
          #4

          应该是定位问题,这个写法还是无效

          <xpath expr="//page/field[@name='order_line']/form/group/group/field[@name='qty_delivered']" position="after">
          <field name="quantity_return"/>

          </xpath>
          <xpath expr="//page/field[@name='order_line']/tree//field[@name='qty_delivered']" position="after">

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Tags
          • Popular
          • Users
          • Groups