因此,当purchase_state处于[purchase]时,我想将Purchase Status(Inside Purchase Request)中的“Purchase Order”字符串更改为“PO Created”之类的字符串,但我不知道该怎么做。我也想创建新的模块。
这是我到目前为止所尝试的。我创建了一个 XML 并继承了视图。
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="purchase_request_form_inherit" model="ir.ui.view">
<field name="name">purchase.request.inherit</field>
<field name="model">purchase.request</field>
<field name="inherit_id" ref="purchase_request.view_purchase_request_form"/>
<field name="arch" type="xml">
<field name="purchase_state" position="attributes">
<attribute name="attrs" string="PO Created" attrs="{'readonly': [('po_line.state','=', 'purchase')]}"/>
</field>
</field>
</record>
</odoo>