Browse Source

Sep 29 : [UPDT] Updated the manifest file 'customer_image_and_tags_in_pos'

pull/284/head
RisvanaCybro 2 years ago
parent
commit
f9c4b793b2
  1. 7
      customer_image_and_tags_in_pos/README.rst
  2. 11
      customer_image_and_tags_in_pos/__manifest__.py
  3. 4
      customer_image_and_tags_in_pos/doc/RELEASE_NOTES.md
  4. 42
      customer_image_and_tags_in_pos/models/pos_session.py
  5. 18
      customer_image_and_tags_in_pos/static/src/js/PartnerLine.js
  6. 4
      customer_image_and_tags_in_pos/static/src/js/customer_tag.js
  7. 2
      customer_image_and_tags_in_pos/static/src/xml/PartnerLine.xml

7
customer_image_and_tags_in_pos/README.rst

@ -1,5 +1,5 @@
.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg
:target: http:s//www.gnu.org/licenses/lgpl-3.0-standalone.html
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
Customer Image And Tags In POS
@ -18,12 +18,13 @@ License
-------
General Public License, Version 3 (LGPL v3).
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html)
(http://www.gnu.org/licenses/lgpl-3.0-standalone.html)
Credits
-------
Developer: (V16) Fathima Mazlin AM, Contact: odoo@cybrosys.com
Developers: Version 16 - Fathima Mazlin AM @cybrosys
Contact: odoo@cybrosys.com
Contacts
--------

11
customer_image_and_tags_in_pos/__manifest__.py

@ -21,15 +21,16 @@
###############################################################################
{
'name': 'Customer Image And Tags In POS',
'version': '16.0.1.0.1',
'category': 'Point of Sale',
'version': '16.0.1.0.0',
'summary': 'Images and tags in pos customer session',
'description': 'Can see the image and tags of customer in '
'customer selection page while choosing'
' the customer in pos',
'category': 'Point of Sale',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'images': ['static/description/banner.png'],
'website': 'https://www.cybrosys.com',
'depends': ['base', 'point_of_sale'],
'assets': {
@ -39,10 +40,8 @@
'customer_image_and_tags_in_pos/static/src/xml/PartnerLine.xml',
],
},
'images': ['static/description/banner.jpg'],
'license': 'LGPL-3',
'application': False,
'installable': True,
'auto_install': False,
'application': False,
'license': 'LGPL-3',
}

4
customer_image_and_tags_in_pos/doc/RELEASE_NOTES.md

@ -5,7 +5,3 @@
#### ADD
- Initial commit for Customer Image And Tags In POS
#### 24.08.2023
#### Version 16.0.1.0.1
#### DEBUG

42
customer_image_and_tags_in_pos/models/pos_session.py

@ -27,51 +27,19 @@ class PosSession(models.Model):
_inherit = 'pos.session'
def _pos_ui_models_to_load(self):
models_to_load = [
'res.company',
"""For load module to POS"""
result = super()._pos_ui_models_to_load()
result += [
'res.partner.category',
'decimal.precision',
'uom.uom',
'res.country.state',
'res.country',
'res.lang',
'account.tax',
'pos.session',
'pos.config',
'pos.bill',
'res.partner',
'stock.picking.type',
'res.users',
'product.pricelist',
'res.currency',
'pos.category',
'product.product',
'product.packaging',
'account.cash.rounding',
'pos.payment.method',
'account.fiscal.position',
]
return models_to_load
return result
def _loader_params_res_partner_category(self):
"""For load res partner category fields"""
return {
'search_params': {'fields': ['id', 'name']}}
'search_params': {'fields': ['name', 'partner_ids']}}
def _get_pos_ui_res_partner_category(self, params):
"""For getting parameters of res partner category model"""
return self.env['res.partner.category'].search_read(
**params['search_params'])
def _loader_params_res_partner(self):
return {
'search_params': {
'domain': self._get_partners_domain(),
'fields': [
'name', 'street', 'city', 'state_id', 'country_id',
'vat', 'lang', 'phone', 'zip', 'mobile', 'email',
'category_id', 'barcode', 'write_date',
'property_account_position_id', 'property_product_pricelist', 'parent_name'
],
},
}

18
customer_image_and_tags_in_pos/static/src/js/PartnerLine.js

@ -1,7 +1,5 @@
/** @odoo-module **/
import PartnerLine from 'point_of_sale.PartnerLine';
import rpc from 'web.rpc';
import ajax from 'web.ajax';
import Registries from 'point_of_sale.Registries';
const PosPartnerLine = (PartnerLine) =>
@ -12,15 +10,15 @@ const PosPartnerLine = (PartnerLine) =>
get highlight() {
var self = this;
var tags = []
var customer_tag = self.props.partner.category_id
this.env.pos.customer_tag.forEach(function(items){
customer_tag.forEach(function(item){
if(item == items["id"]){
tags.push(items.name)
}
});
var partner = items.partner_ids
partner.forEach(function(item){
if (self.props.partner.id == item){
tags.push(items.name)
}
});
});
this.props.tags = tags
this.props.partner['tags'] = tags
}
}
Registries.Component.extend(PartnerLine, PosPartnerLine);
Registries.Component.extend(PartnerLine, PosPartnerLine);

4
customer_image_and_tags_in_pos/static/src/js/customer_tag.js

@ -4,11 +4,11 @@ import Registries from 'point_of_sale.Registries';
const CustomerTag = (PosGlobalState) => class CustomerTag extends PosGlobalState {
/**
Load customer tag data to PosGlobalState
load customer tag data to PosGlobalState
**/
async _processData(loadedData) {
await super._processData(loadedData);
this.customer_tag = loadedData['res.partner.category'];
}
}
Registries.Model.extend(PosGlobalState, CustomerTag);
Registries.Model.extend(PosGlobalState, CustomerTag);

2
customer_image_and_tags_in_pos/static/src/xml/PartnerLine.xml

@ -27,7 +27,7 @@
position="after">
<td>
<div>
<t t-esc="props.tags"/>
<t t-esc="props.partner.tags"/>
</div>
</td>
</xpath>

Loading…
Cancel
Save