[IMP] analytic,purchase,sale: misc analytic improvements

1. Order Plans by sequence in the widget and analytic item views
2. Add amount_field to analytic widget in sales and purchase views
3. UI improvements (split plan name and percentage)

Task-3572128

closes odoo/odoo#141030

Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
Habib (ayh)
2023-11-07 19:32:22 +00:00
parent a23e19cf95
commit 00efda4d77
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -213,7 +213,7 @@ class AccountAnalyticPlan(models.Model):
"applicability": plan._get_applicability(**kwargs) if plan in root_plans else 'optional',
"all_account_count": plan.all_account_count
}
for plan in root_plans + forced_plans
for plan in (root_plans + forced_plans).sorted('sequence')
]
def _get_applicability(self, **kwargs):
@@ -30,7 +30,7 @@
<thead>
<tr class="border-bottom">
<th t-foreach="allPlans" t-as="plan" t-key="plan.id">
<span t-out="plan.name"/>(<span t-att-class="totals[plan.id].class" t-out="totals[plan.id].formattedValue"/>)
<span t-out="plan.name"/> (<span t-att-class="totals[plan.id].class" t-out="totals[plan.id].formattedValue"/>)
</th>
<th t-out="'Percentage'" class="numeric_column_width"/>
<th t-if="valueColumnEnabled" class="numeric_column_width" t-out="props.record.fields[props.amount_field].string"/>
+1 -1
View File
@@ -242,7 +242,7 @@
<field name="analytic_distribution" widget="analytic_distribution"
optional="hide"
groups="analytic.group_analytic_accounting"
options="{'product_field': 'product_id', 'business_domain': 'purchase_order'}"/>
options="{'product_field': 'product_id', 'business_domain': 'purchase_order', 'amount_field': 'price_subtotal'}"/>
<field name="product_qty"/>
<field name="qty_received_manual" column_invisible="True"/>
<field name="qty_received_method" column_invisible="True"/>
+1 -1
View File
@@ -513,7 +513,7 @@
<field name="analytic_distribution" widget="analytic_distribution"
optional="hide"
groups="analytic.group_analytic_accounting"
options="{'product_field': 'product_id', 'business_domain': 'sale_order'}"/>
options="{'product_field': 'product_id', 'business_domain': 'sale_order', 'amount_field': 'price_subtotal'}"/>
<field
name="product_uom_qty"
decoration-info="(not display_type and invoice_status == 'to invoice')" decoration-bf="(not display_type and invoice_status == 'to invoice')"