Merge pull request #4798 from expsa/JAZ-3774

[IMP] purchase_requisition_custom: update orde report & precompute is_purchase_budget
This commit is contained in:
abdurrahman-saber 2025-10-02 12:51:16 +03:00 committed by GitHub
commit 7614196341
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 1 deletions

View File

@ -109,7 +109,7 @@ class PurchaseRequisitionCustom(models.Model):
[('department', 'Department'), ('default', 'Default Cost Center'), ('product_line', 'Product Line'),
('project', 'Project')], string='Purchase Cost', default='department')
selected_purchase_id = fields.Many2one("purchase.order", compute="_compute_selected_purchase_order")
is_purchase_budget = fields.Boolean(string="Is Purchase Budget", compute='_compute_purchase_budget')
is_purchase_budget = fields.Boolean(string="Is Purchase Budget", compute='_compute_purchase_budget', default=lambda self: self.env.company.purchase_budget)
type_id_test = fields.Many2one('purchase.requisition.type', string="Agreement Type")
Project_name = fields.Char(string='Project name')
Chair_number = fields.Char(string='Chair number')

View File

@ -13,4 +13,26 @@
</xpath>
</field>
</record>
<template id="report_purchaseorder_document_inherit_add_description" inherit_id="purchase.report_purchaseorder_document">
<xpath expr="//t[@t-foreach='o.order_line']//td[@name='td_taxes']" position="before">
<td>
<span t-field="line.description"/>
</td>
</xpath>
<xpath expr="//thead/tr/th[@name='th_taxes']" position="before">
<th name="order_line_description"><strong>Order Description</strong></th>
</xpath>
</template>
<template id="report_purchasequotation_document_inherit_add_description" inherit_id="purchase.report_purchasequotation_document">
<xpath expr="//td[@id='product']" position="after">
<td>
<span t-field="line.description"/>
</td>
</xpath>
<xpath expr="//thead/tr/th[@name='th_description']" position="after">
<th name="order_line_description"><strong>Order Description</strong></th>
</xpath>
</template>
</odoo>