[IMP] point_of_sale: Allow to filter partners based on pos orders

Especially used for e-marketing to filter the customers who purchased from store using pos.

Related Task ID: 1931528

closes odoo/odoo#30645
This commit is contained in:
Jinal Patel
2019-02-13 07:28:08 +00:00
committed by Yannick Tivisse
parent 2d633fc7ac
commit 7e49fda883
2 changed files with 2 additions and 1 deletions
@@ -11,6 +11,7 @@ class ResPartner(models.Model):
help="The number of point of sales orders related to this customer",
groups="point_of_sale.group_pos_user",
)
pos_order_ids = fields.One2many('pos.order', 'partner_id', readonly=True)
barcode = fields.Char(oldname='ean13', help="Use a barcode to identify this contact from the Point of Sale.", copy=False)
_sql_constraints = [
@@ -12,7 +12,7 @@
context="{'search_default_partner_id': active_id,'default_partner_id': active_id}"
attrs="{'invisible': ['|', ('customer', '=', False), ('pos_order_count', '=', 0)]}"
icon="fa-shopping-bag">
<field string="POS Sales" name="pos_order_count" widget="statinfo"/>
<field string="PoS Orders" name="pos_order_count" widget="statinfo"/>
</button>
</button>
<xpath expr="//group[@name='purchase']" position="after">