diff --git a/sos_inventory/models/__pycache__/sos_ncmr.cpython-310.pyc b/sos_inventory/models/__pycache__/sos_ncmr.cpython-310.pyc index c60edb0..22742de 100644 Binary files a/sos_inventory/models/__pycache__/sos_ncmr.cpython-310.pyc and b/sos_inventory/models/__pycache__/sos_ncmr.cpython-310.pyc differ diff --git a/sos_inventory/models/__pycache__/sos_wo.cpython-310.pyc b/sos_inventory/models/__pycache__/sos_wo.cpython-310.pyc index 8276c38..1b151b5 100644 Binary files a/sos_inventory/models/__pycache__/sos_wo.cpython-310.pyc and b/sos_inventory/models/__pycache__/sos_wo.cpython-310.pyc differ diff --git a/sos_inventory/models/sos_ncmr.py b/sos_inventory/models/sos_ncmr.py index 45aff0e..3f71652 100755 --- a/sos_inventory/models/sos_ncmr.py +++ b/sos_inventory/models/sos_ncmr.py @@ -40,6 +40,7 @@ class NCMR_Model(models.Model): qa_action = fields.Selection([ ('scrap', 'Scrap'),('rework', 'Rework')], string="Action") dispensed_doc_ref = fields.Char(string="Dispensed Doc Ref") dispensed_responsibility = fields.Text(string="Dispensed Responsibility") + return_incoming_resposibility = fields.Char(string="Approved Doc Ref") approved_doc_ref = fields.Char(string="Approved Doc Ref") approved_responsibility = fields.Text(string="Approved Responsibility") customer_complaint_doc_ref = fields.Char(string="Customer Complaint Doc Ref") @@ -112,7 +113,7 @@ class NCMR_Model(models.Model): ('sos_return_fir', 'Return BRR FIR Ref'), ('sos_fir', 'FIR Ref') ], - string="Incoming Document Reference", + string="Document Reference", compute="_compute_combined_incoming_doc_ref", store=False ) diff --git a/sos_inventory/models/sos_wo.py b/sos_inventory/models/sos_wo.py index 45167a7..b3f4610 100755 --- a/sos_inventory/models/sos_wo.py +++ b/sos_inventory/models/sos_wo.py @@ -77,11 +77,28 @@ class sos__wo(models.Model): top_management_approved_on = fields.Datetime(string="Approved On") rounded_total_value = fields.Float(string="Total Value", compute="_compute_total_value", store=True) adjustment_value = fields.Float(string="Round-off", compute="_compute_total_value", store=True) - # @api.model - # def create(self, vals): - # record = super(sos__wo, self).create(vals) - # record.action_esign_btn() - # return record + nre_charges = fields.Monetary(string="NRE Charges", currency_field='currency_id') + nre_tax = fields.Integer(default=18,string="Tax (%)") + nre_tax_amount = fields.Float(string="NRE Tax Value", store=True,readonly=True, compute="_compute_nretax") + nre_total_value = fields.Float(string="Total", store=True) + + @api.depends('nre_charges', 'nre_tax') + def _compute_nretax(self): + for record in self: + if record.nre_charges: + nre_tax_amount = round((record.nre_tax * record.nre_charges) / 100, 2) + exact_total = round(record.nre_charges + nre_tax_amount, 2) + if math.isnan(exact_total) or exact_total is None: + record.total_value = 0.00 + record.nre_total_value = 0.00 + else: + rounded_total = round(exact_total) + + record.nre_total_value = exact_total + record.nre_tax_amount = nre_tax_amount + else: + record.nre_total_value = 0.00 + record.nre_tax_amount = 0.00 def action_amend(self): active_ids = self.env.context.get('active_ids', []) records = self.browse(active_ids) @@ -191,12 +208,12 @@ class sos__wo(models.Model): for record in self: record.gross_value = round(sum(line.total_price for line in record.line_ids), 2) - @api.depends('gross_value') + @api.depends('gross_value','nre_total_value') def _compute_total_value(self): for record in self: if record.wo_planned_at != "inhouse": if record.gross_value: - exact_total = round(record.gross_value, 2) + exact_total = round(record.nre_total_value + record.gross_value, 2) if math.isnan(exact_total) or exact_total is None: record.total_value = 0.00 record.rounded_total_value = 0.00 diff --git a/sos_inventory/security/record_rules.xml b/sos_inventory/security/record_rules.xml index 6dce93d..5059bc1 100755 --- a/sos_inventory/security/record_rules.xml +++ b/sos_inventory/security/record_rules.xml @@ -47,7 +47,12 @@ Sos NCMR: All Records - Read Access - [('rd_user', '=', user.id), ('rework_responsible_rd_user', '=', user.id)] + + ['|', + ('rd_user', 'in', [user.id]), + ('rework_responsible_rd_user', '=', user.id) + ] + diff --git a/sos_inventory/views/sos_deliverables_boq_view.xml b/sos_inventory/views/sos_deliverables_boq_view.xml index bb171e5..a0c62a7 100755 --- a/sos_inventory/views/sos_deliverables_boq_view.xml +++ b/sos_inventory/views/sos_deliverables_boq_view.xml @@ -81,7 +81,7 @@ - + @@ -94,7 +94,7 @@ - + @@ -107,7 +107,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -134,7 +134,7 @@ - + diff --git a/sos_inventory/views/sos_ncmr_view.xml b/sos_inventory/views/sos_ncmr_view.xml index 98e63b0..8624749 100755 --- a/sos_inventory/views/sos_ncmr_view.xml +++ b/sos_inventory/views/sos_ncmr_view.xml @@ -173,16 +173,19 @@ -In-Coming Material (RM/PM) +In-Coming Material (RM/PM) +Return In-Coming Material (RM/PM) + +Approved Finished Products +Returned Finished Products +Finished Products(Production Assy) diff --git a/sos_inventory/views/sos_wo_view.xml b/sos_inventory/views/sos_wo_view.xml index c26475a..18fda30 100755 --- a/sos_inventory/views/sos_wo_view.xml +++ b/sos_inventory/views/sos_wo_view.xml @@ -147,6 +147,35 @@ +