14.0 account budget forecast #4

Merged
stephansainleger merged 9 commits from 14.0-account_budget_forecast into 14.0 2022-06-30 12:17:46 +00:00
3 changed files with 0 additions and 22 deletions
Showing only changes of commit b265056ed7 - Show all commits

View File

@@ -68,13 +68,6 @@ class BudgetForecast(models.Model):
copy=False,
)
actual_qty = fields.Float(
"Actual Quantity",
compute="_calc_actual",
store=True,
compute_sudo=True,
copy=False,
)
actual_amount = fields.Float(
"Expenses",
compute="_calc_actual",
@@ -390,7 +383,6 @@ class BudgetForecast(models.Model):
if record.display_type in ["line_section", "line_subsection"]:
if record.child_ids:
# Actual expenses are calculated with the child lines
record.actual_qty = sum(record.mapped("child_ids.actual_qty"))
record.actual_amount = sum(record.mapped("child_ids.actual_amount"))
# Incomes are calculated with the analytic lines
@@ -415,7 +407,6 @@ class BudgetForecast(models.Model):
# Note
elif record.display_type == "line_note":
record.actual_qty = 0
record.actual_amount = 0.00
# Product
@@ -423,7 +414,6 @@ class BudgetForecast(models.Model):
line_ids = record._find_analytic_lines(
["in_invoice", "in_refund", "in_receipt"], True
)
record.actual_qty = abs(sum(line_ids.mapped("unit_amount")))
record.actual_amount = -sum(line_ids.mapped("amount"))
# Add Draft Invoice lines ids
@@ -432,12 +422,10 @@ class BudgetForecast(models.Model):
)
for invoice_line in invoice_lines:
if invoice_line.move_id.move_type == "in_invoice":
record.actual_qty = record.actual_qty + invoice_line.quantity
record.actual_amount = (
record.actual_amount + invoice_line.price_subtotal
)
elif invoice_line.move_id.move_type == "in_refund":
record.actual_qty = record.actual_qty - invoice_line.quantity
record.actual_amount = (
record.actual_amount - invoice_line.price_subtotal
)

View File

@@ -24,7 +24,6 @@
<field name="note" optional="hide" />
<field name="plan_price" />
<field name="plan_qty" />
<field name="actual_qty" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />
<field name="plan_amount_without_coeff" string="Plan Amount before Coeff" />
<field name="plan_amount_with_coeff" string="Plan Amount after Coeff" />
<field name="actual_amount" string="Actual Amount" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />
@@ -51,7 +50,6 @@
<field name="note" optional="hide" />
<field name="plan_price" />
<field name="plan_qty" />
<field name="actual_qty" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />
<field name="plan_amount_without_coeff" string="Plan Amount before Coeff" />
<field name="plan_amount_with_coeff" string="Plan Amount after Coeff" />
<field name="actual_amount" string="Actual Amount" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />
@@ -78,7 +76,6 @@
<field name="note" optional="hide" />
<field name="plan_price" />
<field name="plan_qty" />
<field name="actual_qty" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />
<field name="plan_amount_without_coeff" string="Plan Amount before Coeff" />
<field name="plan_amount_with_coeff" string="Plan Amount after Coeff" />
<field name="actual_amount" string="Actual Amount" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />
@@ -105,7 +102,6 @@
<field name="note" optional="hide" />
<field name="plan_price" />
<field name="plan_qty" />
<field name="actual_qty" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />
<field name="plan_amount_without_coeff" string="Plan Amount before Coeff" />
<field name="plan_amount_with_coeff" string="Plan Amount after Coeff" />
<field name="actual_amount" string="Actual Amount" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />
@@ -132,7 +128,6 @@
<field name="note" optional="hide" />
<field name="plan_price" />
<field name="plan_qty" />
<field name="actual_qty" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />
<field name="plan_amount_without_coeff" string="Plan Amount before Coeff" />
<field name="plan_amount_with_coeff" string="Plan Amount after Coeff" />
<field name="actual_amount" string="Actual Amount" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />
@@ -159,7 +154,6 @@
<field name="note" optional="hide" />
<field name="plan_price" />
<field name="plan_qty" />
<field name="actual_qty" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />
<field name="plan_amount_without_coeff" string="Plan Amount before Coeff" />
<field name="plan_amount_with_coeff" string="Plan Amount after Coeff" />
<field name="actual_amount" string="Actual Amount" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />
@@ -186,7 +180,6 @@
<field name="note" optional="hide" />
<field name="plan_price" />
<field name="plan_qty" />
<field name="actual_qty" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />
<field name="plan_amount_without_coeff" string="Plan Amount before Coeff" />
<field name="plan_amount_with_coeff" string="Plan Amount after Coeff" />
<field name="actual_amount" string="Actual Amount" attrs="{'column_invisible' : [('parent.display_actual_amounts', '=', False)]}" />

View File

@@ -29,7 +29,6 @@
</group>
<group string="Quantities">
<field name="plan_qty" />
<field name="actual_qty" />
</group>
<group string="Totals">
<field name="plan_amount_without_coeff" />
@@ -50,7 +49,6 @@
<field name="budget_category" />
<field name="plan_price" sum="total" />
<field name="plan_qty" sum="total" />
<field name="actual_qty" sum="total" />
<field name="plan_amount_without_coeff" sum="total" />
<field name="plan_amount_with_coeff" sum="total" />
<field name="actual_amount" sum="total" />
@@ -77,7 +75,6 @@
<field name="budget_category" />
<field name="plan_price" sum="total" />
<field name="plan_qty" sum="total" />
<field name="actual_qty" sum="total" />
<field name="plan_amount_without_coeff" sum="total" />
<field name="plan_amount_with_coeff" sum="total" />
<field name="actual_amount" sum="total" />