[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:
@@ -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):
|
||||
|
||||
+1
-1
@@ -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"/>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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')"
|
||||
|
||||
Reference in New Issue
Block a user