|
@@ -156,6 +156,36 @@ class EiruPOS(models.Model):
|
|
|
|
|
|
return currencies
|
|
|
|
|
|
+ @api.model
|
|
|
+ def get_customers(self):
|
|
|
+ domain = [('customer', '=', True), ('is_company', '=', False), ('active', '=', True)]
|
|
|
+ customers = []
|
|
|
+
|
|
|
+ for customer in self.env['res.partner'].search(domain):
|
|
|
+ categories = []
|
|
|
+
|
|
|
+ for category in customer.category_id:
|
|
|
+ categories.append({
|
|
|
+ 'id': category.id,
|
|
|
+ 'name': category.name,
|
|
|
+ 'display_name': category.display_name
|
|
|
+ })
|
|
|
+
|
|
|
+ customers.append({
|
|
|
+ 'id': customer.id,
|
|
|
+ 'name': customer.name,
|
|
|
+ 'display_name': customer.display_name,
|
|
|
+ 'image_medium': customer.image_medium,
|
|
|
+ 'phone': customer.phone,
|
|
|
+ 'mobile': customer.mobile,
|
|
|
+ 'email': customer.email,
|
|
|
+ 'categories': categories
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ return customers
|
|
|
+
|
|
|
+
|
|
|
class eiru_pos_session(models.Model):
|
|
|
_name = 'eiru.pos.session'
|
|
|
|