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. 10
      customer_image_and_tags_in_pos/static/src/js/PartnerLine.js
  6. 2
      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 .. 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 :alt: License: LGPL-3
Customer Image And Tags In POS Customer Image And Tags In POS
@ -18,12 +18,13 @@ License
------- -------
General Public License, Version 3 (LGPL v3). 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 Credits
------- -------
Developer: (V16) Fathima Mazlin AM, Contact: odoo@cybrosys.com Developers: Version 16 - Fathima Mazlin AM @cybrosys
Contact: odoo@cybrosys.com
Contacts Contacts
-------- --------

11
customer_image_and_tags_in_pos/__manifest__.py

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

4
customer_image_and_tags_in_pos/doc/RELEASE_NOTES.md

@ -5,7 +5,3 @@
#### ADD #### ADD
- Initial commit for Customer Image And Tags In POS - 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' _inherit = 'pos.session'
def _pos_ui_models_to_load(self): def _pos_ui_models_to_load(self):
models_to_load = [ """For load module to POS"""
'res.company', result = super()._pos_ui_models_to_load()
result += [
'res.partner.category', '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): def _loader_params_res_partner_category(self):
"""For load res partner category fields""" """For load res partner category fields"""
return { return {
'search_params': {'fields': ['id', 'name']}} 'search_params': {'fields': ['name', 'partner_ids']}}
def _get_pos_ui_res_partner_category(self, params): def _get_pos_ui_res_partner_category(self, params):
"""For getting parameters of res partner category model""" """For getting parameters of res partner category model"""
return self.env['res.partner.category'].search_read( return self.env['res.partner.category'].search_read(
**params['search_params']) **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'
],
},
}

10
customer_image_and_tags_in_pos/static/src/js/PartnerLine.js

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

2
customer_image_and_tags_in_pos/static/src/js/customer_tag.js

@ -4,7 +4,7 @@ import Registries from 'point_of_sale.Registries';
const CustomerTag = (PosGlobalState) => class CustomerTag extends PosGlobalState { const CustomerTag = (PosGlobalState) => class CustomerTag extends PosGlobalState {
/** /**
Load customer tag data to PosGlobalState load customer tag data to PosGlobalState
**/ **/
async _processData(loadedData) { async _processData(loadedData) {
await super._processData(loadedData); await super._processData(loadedData);

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

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

Loading…
Cancel
Save