summaryrefslogtreecommitdiff
path: root/addons/lunch/report
diff options
context:
space:
mode:
authornje-odoo <nje@odoo.com>2019-12-02 11:15:34 +0000
committerYannick Tivisse <yti@odoo.com>2019-12-31 12:17:26 +0000
commit92472fbf9cabcc7c8a7bb5703bd5ac85ccd3a55e (patch)
treecfaa24fefb0f81cf5b3597fab03b629fb0eea60f /addons/lunch/report
parent5b62f6e0b629eaa42d86edebe23b426d4cbdd46b (diff)
[IMP] lunch : make field translatable.
Now we can translate name and description field in lunch.product object and we want that translation in kanban view of 'lunch.product.report'. So we set related field in 'lunch.product.report' and remove those fields from init(). Due to related field it will affect on performace of lunch.product.report kanban view loading. Task-2068989 closes odoo/odoo#41206 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/lunch/report')
-rw-r--r--addons/lunch/report/lunch_product_report.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/addons/lunch/report/lunch_product_report.py b/addons/lunch/report/lunch_product_report.py
index f61c2724fb3..bd2f93600c5 100644
--- a/addons/lunch/report/lunch_product_report.py
+++ b/addons/lunch/report/lunch_product_report.py
@@ -13,9 +13,9 @@ class LunchProductReport(models.Model):
id = fields.Integer('ID')
product_id = fields.Many2one('lunch.product', 'Product')
- name = fields.Char('Product Name')
+ name = fields.Char('Product Name', related='product_id.name')
category_id = fields.Many2one('lunch.product.category', 'Product Category')
- description = fields.Text('Description')
+ description = fields.Text('Description', related='product_id.description')
price = fields.Float('Price')
supplier_id = fields.Many2one('lunch.supplier', 'Vendor')
company_id = fields.Many2one('res.company')
@@ -81,9 +81,7 @@ class LunchProductReport(models.Model):
SELECT
row_number() over (ORDER BY users.id,product.id) AS id,
product.id AS product_id,
- product.name,
product.category_id,
- product.description,
product.price,
product.supplier_id,
product.company_id,