diff options
| author | Ankita Raval <anr@odoo.com> | 2019-05-07 11:19:20 +0000 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2019-06-11 12:39:15 +0000 |
| commit | 5a34d64a44ec99ef99f8f5bfba000c33d2e0adf8 (patch) | |
| tree | 90a7dbcdfc0f80681f5280e87ee8742a6dfb5003 /addons | |
| parent | 2ed1a5bef83fa41f66ca0b9ff3649a8668b49d3f (diff) | |
[FIX] mrp: bom structure report
The "BoM Structure report" should not include the cost of the products
as it is often shared with third parties. We now only display the cost
on the "BoM Structure and Cost report" and remove the "BoM Cost report"
as it is redundant with the former.
Task Id: 1969709
closes odoo/odoo#33323
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/mrp/report/mrp_report_bom_structure.xml | 8 | ||||
| -rw-r--r-- | addons/mrp/static/src/js/mrp_bom_report.js | 5 | ||||
| -rw-r--r-- | addons/mrp/static/src/xml/mrp.xml | 1 |
3 files changed, 5 insertions, 9 deletions
diff --git a/addons/mrp/report/mrp_report_bom_structure.xml b/addons/mrp/report/mrp_report_bom_structure.xml index 1b770c57c7b..59a363950a4 100644 --- a/addons/mrp/report/mrp_report_bom_structure.xml +++ b/addons/mrp/report/mrp_report_bom_structure.xml @@ -26,7 +26,7 @@ <th name="th_mrp_bom_h">BoM</th> <th class="text-right">Quantity</th> <th class="text-left" groups="uom.group_uom">Unit of Measure</th> - <th t-if="data['report_structure'] != 'bom_cost'" class="o_mrp_prod_cost text-right" title="This is the cost defined on the product.">Product Cost</th> + <th t-if="data['report_structure'] != 'bom_structure'" class="o_mrp_prod_cost text-right" title="This is the cost defined on the product.">Product Cost</th> <th t-if="data['report_structure'] != 'bom_structure'" class="o_mrp_bom_cost text-right" title="This is the cost based on the BoM of the product. It is computed by summing the costs of the components and operations needed to build the product.">BoM Cost</th> <th t-if="data['report_type'] == 'html' and data['has_attachments']" class="o_mrp_has_attachments" title="Files attached to the product">Attachments</th> </tr> @@ -41,7 +41,7 @@ </td> <td class="text-right"><span><t t-esc="data['bom_qty']" t-options='{"widget": "float", "decimal_precision": "Product Unit of Measure"}'/></span></td> <td groups="uom.group_uom"><span><t t-esc="data['bom'].product_uom_id.name"/></span></td> - <td t-if="data['report_structure'] != 'bom_cost'" class="o_mrp_prod_cost text-right"> + <td t-if="data['report_structure'] != 'bom_structure'" class="o_mrp_prod_cost text-right"> <span><t t-esc="data['price']" t-options='{"widget": "monetary", "display_currency": currency}'/></span> </td> <td t-if="data['report_structure'] != 'bom_structure'" class="o_mrp_bom_cost text-right"> @@ -64,7 +64,7 @@ <td name="td_mrp_bom_f"></td> <td class="text-right"><span><strong>Unit Cost</strong></span></td> <td groups="uom.group_uom"></td> - <td t-if="data['report_structure'] != 'bom_cost'" class="o_mrp_prod_cost text-right"> + <td t-if="data['report_structure'] != 'bom_structure'" class="o_mrp_prod_cost text-right"> <span><t t-esc="data['price']/data['bom_qty']" t-options='{"widget": "monetary", "display_currency": currency}'/></span> </td> <td t-if="data['report_structure'] != 'bom_structure'" class="o_mrp_bom_cost text-right"> @@ -195,7 +195,7 @@ </span> </td> <td groups="uom.group_uom"><span><t t-esc="l['uom']"/></span></td> - <td t-if="data['report_structure'] != 'bom_cost'" class="o_mrp_prod_cost text-right"> + <td t-if="data['report_structure'] != 'bom_structure'" class="o_mrp_prod_cost text-right"> <span t-if="'prod_cost' in l" t-esc="l['prod_cost']" t-options='{"widget": "monetary", "display_currency": currency}'/> </td> <td t-if="data['report_structure'] != 'bom_structure'" class="o_mrp_bom_cost text-right"> diff --git a/addons/mrp/static/src/js/mrp_bom_report.js b/addons/mrp/static/src/js/mrp_bom_report.js index 8a96c5d6d67..9a359ea2b79 100644 --- a/addons/mrp/static/src/js/mrp_bom_report.js +++ b/addons/mrp/static/src/js/mrp_bom_report.js @@ -195,10 +195,7 @@ var MrpBomReport = stock_report_generic.extend({ _reload_report_type: function () { this.$('.o_mrp_bom_cost.o_hidden, .o_mrp_prod_cost.o_hidden').toggleClass('o_hidden'); if (this.given_context.report_type === 'bom_structure') { - this.$('.o_mrp_bom_cost').toggleClass('o_hidden'); - } - if (this.given_context.report_type === 'bom_cost') { - this.$('.o_mrp_prod_cost').toggleClass('o_hidden'); + this.$('.o_mrp_bom_cost, .o_mrp_prod_cost').toggleClass('o_hidden'); } }, _removeLines: function ($el) { diff --git a/addons/mrp/static/src/xml/mrp.xml b/addons/mrp/static/src/xml/mrp.xml index 3fef5761c72..20dd96c6542 100644 --- a/addons/mrp/static/src/xml/mrp.xml +++ b/addons/mrp/static/src/xml/mrp.xml @@ -30,7 +30,6 @@ <select class="o_input o_mrp_bom_report_type"> <option t-att-data-type="'all'">BoM Structure & Cost</option> <option t-att-data-type="'bom_structure'">BoM Structure</option> - <option t-att-data-type="'bom_cost'">BoM Cost</option> </select> </div> </form> |
