添加采购类型字段

This commit is contained in:
mgw
2024-11-06 09:23:14 +08:00
parent fd55abec72
commit 106945fba7
2 changed files with 7 additions and 0 deletions

View File

@@ -208,6 +208,8 @@ class RePurchaseOrder(models.Model):
compute='_compute_user_id',
store=True)
purchase_type = fields.Selection([('standard', '标准采购'), ('consignment', '委外加工')], string='采购类型', default='standard')
@api.depends('partner_id')
def _compute_user_id(self):
if not self.user_id:

View File

@@ -158,6 +158,11 @@
<attribute name="attrs">{'readonly': [('state', 'in', ['purchase'])]}
</attribute>
</field>
<!-- 添加采购类型字段 -->
<field name="partner_ref" position="after">
<field name="purchase_type" string="采购类型" readonly="1"/>
</field>
</field>
</record>