diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-06-20 09:41:19 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-06-20 09:41:19 +0700 |
| commit | e819131a029681b10d5bafb2f4dc3948c429e776 (patch) | |
| tree | 4e5dedf7c562abbbd9aeed5aabbd4627a675d4be | |
| parent | ffd43157bb5afc75d6f710e33607f59e48aaf0ab (diff) | |
activate fullfilment on sale order
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 16 | ||||
| -rwxr-xr-x | indoteknik_custom/views/sale_order.xml | 10 |
2 files changed, 13 insertions, 13 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 91792b59..de61fb72 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -9,7 +9,7 @@ _logger = logging.getLogger(__name__) class SaleOrder(models.Model): _inherit = "sale.order" - # fullfillment_line = fields.One2many('sales.order.fullfillment', 'sales_order_id', string='Fullfillment') + fullfillment_line = fields.One2many('sales.order.fullfillment', 'sales_order_id', string='Fullfillment') order_sales_match_line = fields.One2many('sales.order.purchase.match', 'sales_order_id', string='Purchase Match Lines', states={'cancel': [('readonly', True)], 'done': [('readonly', True)]}, copy=True) total_margin = fields.Float('Total Margin', compute='_compute_total_margin', help="Total Margin in Sales Order Header") total_percent_margin = fields.Float('Total Percent Margin', compute='_compute_total_percent_margin', help="Total % Margin in Sales Order Header") @@ -96,16 +96,16 @@ class SaleOrder(models.Model): ('cust_director', 'Customer Director'), ('cust_procurement', 'Customer Procurement') ], string='Web Approval', copy=False) - # compute_fullfillment = fields.Boolean(string='Compute Fullfillment', compute="_compute_fullfillment") + compute_fullfillment = fields.Boolean(string='Compute Fullfillment', compute="_compute_fullfillment") - # def _compute_fullfillment(self): - # for rec in self: - # rec.fullfillment_line.unlink() + def _compute_fullfillment(self): + for rec in self: + rec.fullfillment_line.unlink() - # for line in rec.order_line: - # line._compute_reserved_from() + for line in rec.order_line: + line._compute_reserved_from() - # rec.compute_fullfillment = True + rec.compute_fullfillment = True def _compute_eta_date(self): max_leadtime = 0 diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 42a101d0..d6738759 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -49,7 +49,7 @@ </field> <field name="user_id" position="after"> <field name="helper_by_id" readonly="1"/> - <!-- <field name="compute_fullfillment"/> --> + <field name="compute_fullfillment"/> </field> <field name="tag_ids" position="after"> <field name="eta_date" readonly="1"/> @@ -187,9 +187,9 @@ <page string="Matches PO" name="page_matches_po" invisible="1"> <field name="order_sales_match_line" readonly="1"/> </page> - <!-- <page string="Fullfillment" name="page_sale_order_fullfillment"> + <page string="Fullfillment" name="page_sale_order_fullfillment"> <field name="fullfillment_line" readonly="1"/> - </page> --> + </page> </page> </field> </record> @@ -296,7 +296,7 @@ </record> </data> - <!-- <data> + <data> <record id="sales_order_fullfillmet_tree" model="ir.ui.view"> <field name="name">sales.order.fullfillment.tree</field> <field name="model">sales.order.fullfillment</field> @@ -309,7 +309,7 @@ </tree> </field> </record> - </data> --> + </data> <data> <record id="mail_template_sale_order_notification_to_salesperson" model="mail.template"> |
