summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_custom/models/promotion/promotion_monitoring.py7
-rw-r--r--indoteknik_custom/views/promotion/promotion_monitoring.xml2
2 files changed, 7 insertions, 2 deletions
diff --git a/indoteknik_custom/models/promotion/promotion_monitoring.py b/indoteknik_custom/models/promotion/promotion_monitoring.py
index 9df0825d..8a8aad8f 100644
--- a/indoteknik_custom/models/promotion/promotion_monitoring.py
+++ b/indoteknik_custom/models/promotion/promotion_monitoring.py
@@ -12,6 +12,7 @@ class PromotionMonitoring(models.Model):
has_promo = fields.Boolean(string="Has Promo")
count_active = fields.Integer(string="Count Active")
count_inactive = fields.Integer(string="Count Inactive")
+ human_last_update = fields.Datetime(string='Human Last Update')
def init(self):
tools.drop_view_if_exists(self.env.cr, self._table)
@@ -27,16 +28,18 @@ class PromotionMonitoring(models.Model):
ppi.computed_price as price,
({count_active} > 0) as has_promo,
{count_active} as count_active,
- {count_inactive} as count_inactive
+ {count_inactive} as count_inactive,
+ pr.human_last_update as human_last_update
FROM product_product p
LEFT JOIN product_template pt ON pt.id = p.product_tmpl_id
LEFT JOIN promotion_product pp ON pp.product_id = p.id
LEFT JOIN promotion_program_line ppl ON ppl.id = pp.program_line_id
LEFT JOIN product_pricelist_item ppi ON ppi.product_id = p.id
+ LEFT JOIN purchase_pricelist pr ON pr.product_id = p.id
WHERE p.active = True
AND pt.sale_ok = True
AND ppi.pricelist_id = 17023
- GROUP BY p.id, ppi.id
+ GROUP BY p.id, ppi.id, pr.human_last_update
)
""".format(
table=self._table,
diff --git a/indoteknik_custom/views/promotion/promotion_monitoring.xml b/indoteknik_custom/views/promotion/promotion_monitoring.xml
index 88325c52..746c3b61 100644
--- a/indoteknik_custom/views/promotion/promotion_monitoring.xml
+++ b/indoteknik_custom/views/promotion/promotion_monitoring.xml
@@ -10,6 +10,7 @@
<field name="has_promo" />
<field name="count_active" />
<field name="count_inactive" />
+ <field name="human_last_update" />
</tree>
</field>
</record>
@@ -28,6 +29,7 @@
<field name="has_promo" />
<field name="count_active" />
<field name="count_inactive" />
+ <field name="human_last_update" />
</group>
</group>
</sheet>