[IMP] point_of_sale: point of sale onboarding improvement.
- Improved description of point of sale application - Removed status from card like 'In Progress' and 'Unused' - Click on top-right corner of POS kanban card, it shows 'Sessions' and 'Sales Orders', now it will shows 'Orders' and 'Sessions'. (for usability purpose). - Improved Multi-Currencies wording same as invoicing - Removed 'Advanced Currencies Setup' from settings(when clicking on 'Multi-Currencies'). - Improved list view label on 'Point of Sale'. - Added 'PoS Product Categories' feature in 'Restrict Available Product Categories'. - In PoS config setting, 'Pos Interface' string is put instead of 'Order Interface'. - Filter and display issues were there when setting 'Currencies' from 'Multi-Currencies', now it is resolved. - String 'PoS Product categories' is put instead of 'PoS Category', as it seems meaningful. - 'Restrict Available Product Category' is ticked but any category is not selected (it means it is kept blank), then all categories are shown at POS screen. - Allow to set default category from the available categories - 'iface_start_categ_domain_ids' is removed because domain for 'iface_start_categ_id' is given directly in the model. So 'iface_start_categ_domain_ids' will not be required anymore. This commit is related to task id: 1925458 closes odoo/odoo#30808 Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
This commit is contained in:
committed by
shreya thakrar
parent
c7c0221a48
commit
bedfaac989
@@ -6,7 +6,7 @@
|
||||
'version': '1.0.1',
|
||||
'category': 'Sales/Point Of Sale',
|
||||
'sequence': 20,
|
||||
'summary': 'Tablet POS: shops and restaurants',
|
||||
'summary': 'User-friendly PoS interface for shops and restaurants',
|
||||
'description': "",
|
||||
'depends': ['stock_account', 'barcodes', 'web_editor', 'digest'],
|
||||
'data': [
|
||||
|
||||
@@ -63,14 +63,7 @@ class PosConfig(models.Model):
|
||||
def _compute_default_customer_html(self):
|
||||
return self.env['ir.qweb'].render('point_of_sale.customer_facing_display_html')
|
||||
|
||||
@api.depends('limit_categories', 'iface_available_categ_ids')
|
||||
def _compute_iface_start_categ_domain_ids(self):
|
||||
if self.limit_categories:
|
||||
self.iface_start_categ_domain_ids = self.iface_available_categ_ids
|
||||
else:
|
||||
self.iface_start_categ_domain_ids = self.env['pos.category'].search([])
|
||||
|
||||
name = fields.Char(string='Point of Sale Name', index=True, required=True, help="An internal identification of the point of sale.")
|
||||
name = fields.Char(string='Point of Sale', index=True, required=True, help="An internal identification of the point of sale.")
|
||||
is_installed_account_accountant = fields.Boolean(string="Is the Full Accounting Installed",
|
||||
compute="_compute_is_installed_account_accountant")
|
||||
journal_ids = fields.Many2many(
|
||||
@@ -110,10 +103,8 @@ class PosConfig(models.Model):
|
||||
iface_tax_included = fields.Selection([('subtotal', 'Tax-Excluded Price'), ('total', 'Tax-Included Price')], string="Tax Display", default='subtotal', required=True)
|
||||
iface_start_categ_id = fields.Many2one('pos.category', string='Initial Category',
|
||||
help='The point of sale will display this product category by default. If no category is specified, all available products will be shown.')
|
||||
iface_available_categ_ids = fields.Many2many('pos.category', string='Available Category Tree',
|
||||
iface_available_categ_ids = fields.Many2many('pos.category', string='Available PoS Product Categories',
|
||||
help='The point of sale will only display products which are within one of the selected category trees. If no category is specified, all available products will be shown')
|
||||
iface_start_categ_domain_ids = fields.Many2many('pos.category', compute='_compute_iface_start_categ_domain_ids', store=False,
|
||||
help='Technical field used as a domain for iface_start_categ_id.')
|
||||
iface_display_categ_images = fields.Boolean(string='Display Category Pictures',
|
||||
help="The product categories will be displayed with pictures.")
|
||||
restrict_price_control = fields.Boolean(string='Restrict Price Modifications to Managers',
|
||||
@@ -164,7 +155,7 @@ class PosConfig(models.Model):
|
||||
use_pricelist = fields.Boolean("Use a pricelist.")
|
||||
tax_regime = fields.Boolean("Tax Regime")
|
||||
tax_regime_selection = fields.Boolean("Tax Regime Selection value")
|
||||
start_category = fields.Boolean("Set Start Category")
|
||||
start_category = fields.Boolean("Set Start Category", default=False)
|
||||
limit_categories = fields.Boolean("Restrict Available Product Categories")
|
||||
module_account = fields.Boolean(string='Invoicing', help='Enables invoice generation from the Point of Sale.')
|
||||
module_pos_restaurant = fields.Boolean("Is a Bar/Restaurant")
|
||||
@@ -322,10 +313,16 @@ class PosConfig(models.Model):
|
||||
|
||||
@api.onchange('limit_categories', 'iface_available_categ_ids', 'iface_start_categ_id')
|
||||
def _onchange_limit_categories(self):
|
||||
res = {}
|
||||
if not self.limit_categories:
|
||||
self.iface_available_categ_ids = False
|
||||
elif not len(self.iface_available_categ_ids):
|
||||
res = {'domain': {'iface_start_categ_id': [('id', 'in', self.env['pos.category'].search([]).ids)]}}
|
||||
elif self.iface_start_categ_id not in self.iface_available_categ_ids:
|
||||
self.iface_start_categ_id = False
|
||||
if self.iface_available_categ_ids:
|
||||
res = {'domain': {'iface_start_categ_id': [('id', 'in', self.iface_available_categ_ids.ids)]}}
|
||||
return res
|
||||
|
||||
@api.onchange('is_header_or_footer')
|
||||
def _onchange_header_footer(self):
|
||||
|
||||
@@ -333,7 +333,7 @@ exports.PosModel = Backbone.Model.extend({
|
||||
model: 'pos.category',
|
||||
fields: ['id', 'name', 'parent_id', 'child_id'],
|
||||
domain: function(self) {
|
||||
return self.config.limit_categories ? [['id', 'in', self.config.iface_available_categ_ids]] : [];
|
||||
return self.config.limit_categories && self.config.iface_available_categ_ids.length ? [['id', 'in', self.config.iface_available_categ_ids]] : [];
|
||||
},
|
||||
loaded: function(self, categories){
|
||||
self.db.add_categories(categories);
|
||||
@@ -346,7 +346,7 @@ exports.PosModel = Backbone.Model.extend({
|
||||
order: _.map(['sequence','default_code','name'], function (name) { return {name: name}; }),
|
||||
domain: function(self){
|
||||
var domain = [['sale_ok','=',true],['available_in_pos','=',true]];
|
||||
if (self.config.limit_categories) {
|
||||
if (self.config.limit_categories && self.config.iface_available_categ_ids.length) {
|
||||
domain.push(['pos_categ_id', 'in', self.config.iface_available_categ_ids]);
|
||||
}
|
||||
return domain;
|
||||
|
||||
@@ -66,9 +66,6 @@
|
||||
<t t-if="record.pos_session_state.raw_value == 'opening_control'">
|
||||
<div class="badge badge-info o_kanban_inline_block">Opening Control</div>
|
||||
</t>
|
||||
<t t-if="record.pos_session_state.raw_value == 'opened'">
|
||||
<div class="badge badge-success o_kanban_inline_block">In Progress</div>
|
||||
</t>
|
||||
<t t-if="record.pos_session_state.raw_value == 'closing_control'">
|
||||
<div class="badge badge-info o_kanban_inline_block">Closing Control</div>
|
||||
</t>
|
||||
@@ -78,8 +75,6 @@
|
||||
To Close
|
||||
</div>
|
||||
</t>
|
||||
<t t-set="unused_message">Unused</t>
|
||||
<div class="o_secondary mt16"><t t-esc="record.pos_session_username.value || unused_message"/></div>
|
||||
</div>
|
||||
<div class="o_kanban_manage_button_section">
|
||||
<a class="o_kanban_manage_toggle_button" href="#"><i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/></a>
|
||||
@@ -125,10 +120,10 @@
|
||||
<span>View</span>
|
||||
</div>
|
||||
<div role="menuitem">
|
||||
<a name="%(action_pos_session_filtered)d" type="action">Sessions</a>
|
||||
<a name="%(action_pos_order_filtered)d" type="action">Orders</a>
|
||||
</div>
|
||||
<div role="menuitem">
|
||||
<a name="%(action_pos_order_filtered)d" type="action">Sales Orders</a>
|
||||
<a name="%(action_pos_session_filtered)d" type="action">Sessions</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 o_kanban_card_manage_section o_kanban_manage_new">
|
||||
|
||||
@@ -4,16 +4,21 @@
|
||||
<field name="name">pos.category.form</field>
|
||||
<field name="model">pos.category</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Pos Categories">
|
||||
<form string="Pos Product Categories">
|
||||
<sheet>
|
||||
<field name="image" widget='image' class="oe_avatar"/>
|
||||
<div class="oe_left">
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1>
|
||||
<field name="name" placeholder="POS Category Name" required="True"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="sequence"/>
|
||||
</group>
|
||||
</div>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
@@ -25,7 +30,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Product Product Categories">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="display_name"/>
|
||||
<field name="display_name" string="PoS Product Category"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -57,7 +62,7 @@
|
||||
</record>
|
||||
|
||||
<record id="product_pos_category_action" model="ir.actions.act_window">
|
||||
<field name="name">PoS Categories</field>
|
||||
<field name="name">PoS Product Categories</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">pos.category</field>
|
||||
<field name="view_type">form</field>
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2 name="order">Order Interface</h2>
|
||||
<h2 name="order">PoS Interface</h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div id="category_reference" class="col-12 col-lg-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
@@ -85,22 +85,7 @@
|
||||
Display pictures of product categories
|
||||
</div>
|
||||
<div class="content-group mt16" attrs="{'invisible': [('iface_display_categ_images', '=', False)]}">
|
||||
<button name="%(product_pos_category_action)d" icon="fa-arrow-right" type="action" string="Categories" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box" >
|
||||
<field name="iface_start_categ_domain_ids" invisible="1"/>
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="start_category"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="start_category"/>
|
||||
<div class="text-muted">
|
||||
Start selling from a default product category
|
||||
</div>
|
||||
<div class="content-group mt16" attrs="{'invisible': [('start_category', '=', False)]}">
|
||||
<field name="iface_start_categ_id" domain="[('id', 'in', iface_start_categ_domain_ids)]"/>
|
||||
<button name="%(product_pos_category_action)d" icon="fa-arrow-right" type="action" string="PoS Product Categories" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -116,6 +101,9 @@
|
||||
<div class="content-group mt16" attrs="{'invisible': [('limit_categories', '=', False)]}">
|
||||
<field name="iface_available_categ_ids" widget="many2many_tags"/>
|
||||
</div>
|
||||
<div class="content-group mt16" attrs="{'invisible': [('limit_categories', '=', False)]}">
|
||||
<button name="%(product_pos_category_action)d" icon="fa-arrow-right" type="action" string="PoS Product Categories" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box" title="Don't turn this option on if you take orders on smartphones or tablets. Such devices already benefit from a native keyboard.">
|
||||
@@ -129,6 +117,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="start_category"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="start_category"/>
|
||||
<div class="text-muted">
|
||||
Start selling from a default product category
|
||||
</div>
|
||||
<div class="content-group mt16" attrs="{'invisible': [('start_category', '=', False)]}">
|
||||
<field name="iface_start_categ_id"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box" >
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="iface_big_scrollbars"/>
|
||||
|
||||
@@ -57,15 +57,12 @@
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_multi_currency"/>
|
||||
<div class="text-muted">
|
||||
Sell in several currencies
|
||||
Record transactions in foreign currencies
|
||||
</div>
|
||||
<div class="content-group" attrs="{'invisible': [('group_multi_currency', '=', False)]}">
|
||||
<div class="mt16">
|
||||
<button type="action" name="%(base.action_currency_form)d" string="Currencies" class="btn-link" icon="fa-arrow-right"/>
|
||||
</div>
|
||||
<div>
|
||||
<button name="%(base.action_currency_all_form)d" icon="fa-arrow-right" type="action" string="Advanced Currencies Setup" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Currencies">
|
||||
<field name="name" string="Currency"/>
|
||||
<field name="active"/>
|
||||
<filter name="active" string="Active" domain="[('active','=',True)]" help="Show active currencies"/>
|
||||
<filter name="inactive" string="Inactive" domain="[('active','=',False)]" help="Show inactive currencies"/>
|
||||
</search>
|
||||
|
||||
Reference in New Issue
Block a user