Skip to content

Commit

Permalink
[RFT] - Changes to PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Franco committed Nov 14, 2023
1 parent 1b8a3cc commit 6d073c9
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
3 changes: 1 addition & 2 deletions pos_product_available/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ class ProductTemplate(models.Model):
pos_center_ids = fields.Many2many(
comodel_name='pos.config',
string='PdV Visibles',
)

)
5 changes: 2 additions & 3 deletions pos_product_available/views/point_of_sale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
<odoo>
<template id="pos_assets_inherit" inherit_id="point_of_sale.assets"
name="point_of_sale assets inherit">
<xpath expr="//script[contains(@src, '/point_of_sale/static/src/js/models.js')]"
position="replace">
<xpath expr="//script[contains(@src, '/point_of_sale/static/src/js/models.js')]" position="replace">
<script type="text/javascript" src="/pos_product_available/static/src/js/models.js"></script>
</xpath>
</template>
</odoo>
</odoo>
24 changes: 18 additions & 6 deletions pos_product_available/views/pos_config_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,32 @@
<record id="pos_config_view_form" model="ir.ui.view">
<field name="name">pos.config.form.view.inherit</field>
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.pos_config_view_form"/>
<field name="inherit_id" ref="point_of_sale.pos_config_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@class='row mt16 o_settings_container']/div[@class='col-12 col-lg-6 o_setting_box']/div[@class='o_setting_left_pane']/field[@name='limit_categories']/../.." position="after">
<div class="col-12 col-lg-6 o_setting_box" >
<xpath
expr="//div[@class='row mt16 o_settings_container']/div[@class='col-12 col-lg-6 o_setting_box']/div[@class='o_setting_left_pane']/field[@name='limit_categories']/../.."
position="after"
>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="available_product" attrs="{'readonly': [('has_active_session','=', True)]}"/>
<field
name="available_product"
attrs="{'readonly': [('has_active_session','=', True)]}"
/>
</div>
<div class="o_setting_right_pane">
<label for="available_product"/>
<label for="available_product" />
<div class="text-muted">
Products for this PdV
</div>
<div class="content-group mt16" attrs="{'invisible': True}">
<field name="available_product_ids" domain="[('available_in_pos','=', True), ('pos_categ_id', 'in', iface_available_categ_ids)]" options="{'no_create': True}" widget="many2many_tags" attrs="{'readonly': [('has_active_session','=', True)]}" />
<field
name="available_product_ids"
domain="[('available_in_pos','=', True), ('pos_categ_id', 'in', iface_available_categ_ids)]"
options="{'no_create': True}"
widget="many2many_tags"
attrs="{'readonly': [('has_active_session','=', True)]}"
/>
</div>
</div>
</div>
Expand Down
15 changes: 10 additions & 5 deletions pos_product_available/views/product_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="point_of_sale.product_template_form_view" />
<field name="arch" type="xml">
<xpath expr="//page[@name='pos']/group/group/field[@name='to_weight']" position="after">
<field name="pos_center_ids"
attrs="{'invisible': [('available_in_pos', '=', False)]}"
options="{'no_create': True}" widget="many2many_tags" />
<xpath
expr="//page[@name='pos']/group/group/field[@name='to_weight']"
position="after"
>
<field
name="pos_center_ids"
attrs="{'invisible': [('available_in_pos', '=', False)]}"
options="{'no_create': True}" widget="many2many_tags"
/>
</xpath>
</field>
</record>
</odoo>
</odoo>

0 comments on commit 6d073c9

Please sign in to comment.