问题描述
我坚持这种定制已有几个星期了。我正在使用odoo 13 CE。
我想将“订单行”列表复制到odoo中自定义笔记本(标签)的简单文本中。
来自此:
为此:
我所做的是制作相关字段和自定义视图。
py文件:
from odoo import models,fields
class SaleOrder(models.Model):
_inherit = 'sale.order'
partner_id_wa = fields.Many2one(related='partner_id')
phone_wa = fields.Char(related='phone')
amount_total_wa = fields.Monetary(related='amount_total')
order_line_wa = fields.One2many(related='order_line')
order_line_waa = fields.One2many('sale.order.line','name','Order Lines',related='order_line')
product_id_wa = fields.Many2one(related='order_line.product_id')
product_uom_qty_wa = fields.Float(related='order_line.product_uom_qty')
price_subtotal_wa = fields.Monetary(related='order_line.price_subtotal')
xml文件:
<notebook position="inside">
<page string="Special Notes">
<label for="special_notes_1" string="Special Notes"/>
<div class="o_specnotes_format border">
<field name="special_notes_1" placeholder="Header: Dear,..." class="o_specnotes_sn1"/>
<br></br>
<field name="special_notes_2" placeholder="Body: Happy Birthday..." class="o_specnotes_sn2"/>
<br></br>
<field name="special_notes_3" placeholder="Footer: Sincerely,..." class="o_specnotes_sn3"/>
</div>
</page>
<page string = "Invoice WA">
<div>
<field name="partner_id_wa" options="{'no_open': True}" readonly="1"/>
<br></br>
<field name="phone_wa" readonly="1"></field>
<br></br>
<field name="product_id_wa"/> - <field name="product_uom_qty_wa"/>: <field name="price_subtotal_wa"/>
<br></br>
<field name="amount_total_wa"></field>
</div>
</page>
</notebook>
还有其他更好的方法吗?如何纠正?谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)