[FIX]FIX issue in project

This commit is contained in:
zainab8585 2024-07-17 05:37:45 +02:00
parent f8acbe4c04
commit b4000f5707
4 changed files with 13 additions and 13 deletions

View File

@ -67,12 +67,12 @@ class Project(models.Model):
close_reason = fields.Text(string="Close Reason")
project_team_ids = fields.One2many('project.team', 'project_id', string="Project Team")
invoice_ids = fields.One2many('project.invoice', 'project_id', "Invoice", copy=False, help="The Details of invoice")
total_invoiced_amount = fields.Float('Total Invoiced Amount', compute='compute_total_invoiced_amount')
total_invoiced_amount = fields.Float('Total Invoiced Amount',store=True, compute='compute_total_invoiced_amount')
no_of_invoices = fields.Integer(compute='compute_total_invoiced_payment')
no_of_paid_invoices = fields.Integer(compute='compute_total_invoiced_payment')
total_invoiced_payment = fields.Float('Paid Amount', compute='compute_total_invoiced_payment')
residual_amount = fields.Float('Remaining Amount', compute='compute_residual_amount')
back_log_amount = fields.Float('Back Log Amount', compute='compute_back_log_amount')
total_invoiced_payment = fields.Float('Paid Amount',store=True, compute='compute_total_invoiced_payment')
residual_amount = fields.Float('Remaining Amount',store=True, compute='compute_residual_amount')
back_log_amount = fields.Float('Back Log Amount',store=True, compute='compute_back_log_amount')
# TODO check if this fields needed
is_down_payment = fields.Boolean('Down Payment')
to_invoice = fields.Boolean(compute="compute_to_invoice", store=True)

View File

@ -34,8 +34,8 @@ class ProjectInvoice(models.Model):
project_downinv_ids = fields.One2many('project.invoice.line', 'project_invoice_id', string='Lines',
domain=[('is_downpayment', '=', True)])
currency_id = fields.Many2one(related="project_id.currency_id", store=True)
payment_amount = fields.Monetary(string='Paid Amount', compute="_compute_payment_amount")
residual_amount = fields.Monetary('Remaining Amount', compute_sudo=True , compute='_compute_indo_invoice_id')
payment_amount = fields.Monetary(string='Paid Amount',store=True, compute="_compute_payment_amount")
residual_amount = fields.Monetary('Remaining Amount',store=True, compute_sudo=True , compute='_compute_indo_invoice_id')
invoice_type = fields.Selection([('project', 'Project'), ('consultant','Consultant'),
('variation_order', 'Variation Order')], string='Invoice Type', default='project')
has_downpayment = fields.Boolean(compute="_check_downpayment")
@ -269,7 +269,7 @@ class ProjectInvoiceLine(models.Model):
product_uom_qty = fields.Float(string='Percentage', digits='Product Unit of Measure', required=True, default=0.0)
amount = fields.Monetary("Amount")
product_uom = fields.Many2one('uom.uom', string='Unit of Measure', )
price_unit = fields.Float('Unit Price', digits='Project Amount', compute="get_price_unit_value")
price_unit = fields.Float('Unit Price', digits='Project Amount',store=True, compute="get_price_unit_value")
discount = fields.Float(string='Discount (%)', digits='Discount')
price_subtotal = fields.Monetary(string='Subtotal', store=True)
price_tax = fields.Float(string='Total Tax', compute="_compute_amount", store=True)

View File

@ -57,11 +57,11 @@
<field name="qty_invoiced" decoration-info="(qty_invoiced)" decoration-bf="(qty_invoiced)" force_save="1" optional="hide"/>
<field name="product_uom" attrs="{'readonly': ['|', ('parent.state', '!=', 'draft'), ('parent.invoice_type', '=', 'project')]}" optional="hide" force_save="1"/>
<field name="price_unit" attrs="{'readonly': ['|', ('parent.state', '!=', 'draft'), ('parent.invoice_type', '=', 'project')]}" force_save="1"/>
<field name="price_subtotal"/>
<field name="price_subtotal" force_save="1"/>
<field name="tax_id" widget="many2many_tags" options="{'no_create': True}" attrs="{'readonly': [ ('parent.state', '!=', 'draft')]}" force_save="1"/>
<field name="price_tax"/>
<field name="price_tax" force_save="1"/>
<field name="price_total"/>
<field name="price_total" force_save="1"/>
</tree>
</field>
<separator string="DowmPayment" attrs="{'invisible':[('has_downpayment', '!=', True)]}"/>

View File

@ -172,7 +172,7 @@
</xpath>
<xpath expr="//page[@name='description_page']" position="after">
<page name="team" attrs="{'invisible':[('state','in',['draft'])]}" string="Project Team">
<page name="team" string="Project Team">
<field name="project_team_ids" nolabel="1">
<tree editable="top">
<field name="employee_id" required="1" />
@ -224,12 +224,12 @@
<div class="oe_subtotal_footer_separator oe_inline o_td_label">
<label for="total_invoiced_payment" />
</div>
<field name="total_invoiced_payment" nolabel="1" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}" />
<field name="total_invoiced_payment" force_save="1" nolabel="1" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}" />
<div class="oe_subtotal_footer_separator oe_inline o_td_label">
<label for="residual_amount" />
</div>
<field name="residual_amount" nolabel="1" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}" />
<field name="residual_amount" force_save="1" nolabel="1" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}" />
</group>
<div class="oe_clear" />
</group>