Feature #13
Binary file not shown.
Binary file not shown.
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -47,7 +47,12 @@
|
|||
<record id="sos_ncmr_all_records_rule" model="ir.rule">
|
||||
<field name="name">Sos NCMR: All Records - Read Access</field>
|
||||
<field name="model_id" ref="model_sos_ncmr"/>
|
||||
<field name="domain_force">[('rd_user', '=', user.id), ('rework_responsible_rd_user', '=', user.id)]</field>
|
||||
<field name="domain_force">
|
||||
['|',
|
||||
('rd_user', 'in', [user.id]),
|
||||
('rework_responsible_rd_user', '=', user.id)
|
||||
]
|
||||
</field>
|
||||
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
|
||||
<field name="perm_read" eval="1"/>
|
||||
<field name="perm_write" eval="1"/>
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@
|
|||
|
||||
<notebook>
|
||||
<page string="Finished Goods">
|
||||
<field name="line_ids_fg">
|
||||
<field name="line_ids_fg" readonly="scg_head_verified_by">
|
||||
<tree editable="bottom">
|
||||
<field name="component_id"/>
|
||||
<field name="add_production_cost" widget="boolean_toggle"/>
|
||||
|
|
@ -94,7 +94,7 @@
|
|||
</field>
|
||||
</page>
|
||||
<page string="Semi Finished Goods">
|
||||
<field name="line_ids_sfg">
|
||||
<field name="line_ids_sfg" readonly="scg_head_verified_by">
|
||||
<tree editable="bottom">
|
||||
<field name="component_id"/>
|
||||
<field name="add_production_cost" widget="boolean_toggle"/>
|
||||
|
|
@ -107,7 +107,7 @@
|
|||
</field>
|
||||
</page>
|
||||
<page string="Materials">
|
||||
<field name="line_ids_material">
|
||||
<field name="line_ids_material" readonly="scg_head_verified_by">
|
||||
<tree editable="bottom">
|
||||
<field name="component_id"/>
|
||||
<field name="display_name"/>
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
</field>
|
||||
</page>
|
||||
<page string="Installation Kit">
|
||||
<field name="line_ids_installation_kit">
|
||||
<field name="line_ids_installation_kit" readonly="scg_head_verified_by">
|
||||
<tree editable="bottom">
|
||||
<field name="component_id"/>
|
||||
<field name="display_name"/>
|
||||
|
|
@ -134,7 +134,7 @@
|
|||
</field>
|
||||
</page>
|
||||
<page string="Miscellaneous">
|
||||
<field name="line_ids_miscellaneous">
|
||||
<field name="line_ids_miscellaneous" readonly="scg_head_verified_by">
|
||||
<tree editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="cost"/>
|
||||
|
|
|
|||
|
|
@ -173,16 +173,19 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td class="column">In-Coming Material (RM/PM)</td><td><field name="combined_incoming_doc_ref"/></td><td><field name="incoming_responsibility"/></td></tr>
|
||||
<tr><td class="column">In-Coming Material (RM/PM)</td><td><field name="incoming_doc_ref"/></td><td><field name="incoming_responsibility"/></td></tr>
|
||||
<tr><td class="column">Return In-Coming Material (RM/PM)</td><td><field name="return_incoming_doc_ref"/></td><td><field name="return_incoming_resposibility"/></td></tr>
|
||||
|
||||
<!--
|
||||
<tr><td class="column">Dispensed Material (RM/PM)</td><td><field name="dispensed_doc_ref"/></td><td><field name="dispensed_responsibility"/></td></tr>
|
||||
|
||||
|
||||
<tr><td class="column">Approved Stored Material (RM/PM)</td><td><field name="approved_doc_ref"/></td><td><field name="approved_responsibility"/></td></tr>
|
||||
<tr><td class="column">Customer Complaint</td><td><field name="customer_complaint_doc_ref"/></td><td><field name="customer_complaint_responsibility"/></td></tr>
|
||||
<tr><td class="column">Approved Finished Products</td><td><field name="approved_fg_doc_ref"/></td><td><field name="approved_fg_responsibility"/></td></tr>
|
||||
<tr><td class="column">Returned Finished Products</td><td><field name="returned_fg_doc_ref"/></td><td><field name="returned_fg_responsibility"/></td></tr>
|
||||
<tr><td class="column">Finished Products(Production Assy)</td><td><field name="finished_fg_assy"/></td><td><field name="finished_fg_assy_responsibility"/></td></tr>
|
||||
-->
|
||||
<tr><td class="column">Approved Finished Products</td><td><field name="fir_incoming_doc_ref"/></td><td><field name="approved_fg_responsibility"/></td></tr>
|
||||
<tr><td class="column">Returned Finished Products</td><td><field name="return_fg_incoming_doc_ref"/></td><td><field name="returned_fg_responsibility"/></td></tr>
|
||||
<tr><td class="column">Finished Products(Production Assy)</td><td><field name="fg_incoming_doc_ref"/></td><td><field name="finished_fg_assy_responsibility"/></td></tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -147,6 +147,35 @@
|
|||
</tree>
|
||||
|
||||
</field>
|
||||
<div class="oe_subtotal_footer" style="float: left;
|
||||
padding: 20px;
|
||||
border: solid 1px #ccc;
|
||||
font-weight: bold;
|
||||
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;">
|
||||
|
||||
<!-- Gross Value Field -->
|
||||
<div style="margin-bottom: 5px;">
|
||||
<label for="nre_charges" style="font-weight: bold; margin-right: 10px;">Delivery Charges</label>
|
||||
<field name="nre_charges" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_inline"/>
|
||||
</div>
|
||||
|
||||
<!-- Tax Field -->
|
||||
<div style="margin-bottom: 5px;">
|
||||
<label for="nre_tax" style="font-weight: bold; margin-right: 10px;">Tax (%)</label>
|
||||
<field name="nre_tax" class="oe_inline"/>
|
||||
</div>
|
||||
<div style="margin-bottom: 5px;">
|
||||
<label for="nre_tax_amount" style="font-weight: bold; margin-right: 10px;">Tax Amount</label>
|
||||
<field name="nre_tax_amount" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_inline"/>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label for="nre_total_value" style="font-weight: bold; margin-right: 10px;">Final Value</label>
|
||||
<field name="nre_total_value" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_inline"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div invisible="wo_planned_at == 'inhouse'" class="oe_subtotal_footer" style="float: right;
|
||||
padding: 34px;
|
||||
border: solid 1px #ccc;
|
||||
|
|
|
|||
Loading…
Reference in New Issue