-
-
Notifications
You must be signed in to change notification settings - Fork 617
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] pos_product_quick_info: Add new module to display product witho…
…ut add in to card
- Loading branch information
1 parent
dbf3aa3
commit d4c5ffc
Showing
18 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
wait a bot :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "PoS Product Quick Info", | ||
"version": "16.0.1.0.0", | ||
"summary": "Display product info by one click in Point of Sale", | ||
"author": "Cetmix, Odoo Community Association (OCA)", | ||
"category": "Point Of Sale", | ||
"license": "AGPL-3", | ||
"depends": ["point_of_sale"], | ||
"website": "https://github.com/OCA/pos", | ||
"maintainers": ["GabbasovDinar", "CetmixGitDrone"], | ||
"data": ["views/res_config_settings_view.xml"], | ||
"assets": { | ||
"point_of_sale.assets": [ | ||
"pos_product_quick_info/static/src/css/pos.css", | ||
"pos_product_quick_info/static/src/js/Screens/ProductScreen/ProductItem.js", | ||
"pos_product_quick_info/static/src/xml/Screens/ProductScreen/ProductItem.xml", | ||
], | ||
}, | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import pos_config | ||
from . import res_config_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class PosConfig(models.Model): | ||
_inherit = "pos.config" | ||
|
||
display_quick_product_info = fields.Boolean(default=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
pos_display_quick_product_info = fields.Boolean( | ||
related="pos_config_id.display_quick_product_info", readonly=False | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* Go to Point Of Sale / Configuration / Point of Sale | ||
* Check the box 'Display Quick Product Info' | ||
|
||
.. figure:: ../static/img/config.png | ||
:width: 800 px |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* Cetmix <https://cetmix.com/> | ||
* Dinar Gabbasov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This module allows you to view information about a product without adding it to cart: | ||
.. image:: ../static/img/info.png |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.pos .product-list .quick-info { | ||
position: absolute; | ||
top: 0px; | ||
left: 0px; | ||
padding: 5px; | ||
font-size: 24px; | ||
} |
18 changes: 18 additions & 0 deletions
18
pos_product_quick_info/static/src/js/Screens/ProductScreen/ProductItem.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
odoo.define("pos_product_quick_info.ProductItem", function (require) { | ||
"use strict"; | ||
|
||
const ProductItem = require("point_of_sale.ProductItem"); | ||
const Registries = require("point_of_sale.Registries"); | ||
|
||
const QuickInfoProductItem = (ProductItem) => | ||
class QuickInfoProductItem extends ProductItem { | ||
async onProductInfoClick(event) { | ||
event.stopPropagation(); | ||
return await super.onProductInfoClick(...arguments); | ||
} | ||
}; | ||
|
||
Registries.Component.extend(ProductItem, QuickInfoProductItem); | ||
|
||
return QuickInfoProductItem; | ||
}); |
26 changes: 26 additions & 0 deletions
26
pos_product_quick_info/static/src/xml/Screens/ProductScreen/ProductItem.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<templates id="template" xml:space="preserve"> | ||
|
||
<t | ||
t-name="ProductItem" | ||
t-inherit="point_of_sale.ProductItem" | ||
t-inherit-mode="extension" | ||
owl="1" | ||
> | ||
<xpath expr="//div[hasclass('product-img')]" position="before"> | ||
<span | ||
t-if="env.pos.config.display_quick_product_info" | ||
class="quick-info" | ||
t-on-click="onProductInfoClick" | ||
> | ||
<i | ||
class="fa fa-info-circle" | ||
role="img" | ||
aria-label="Info" | ||
title="Info" | ||
/> | ||
</span> | ||
</xpath> | ||
</t> | ||
|
||
</templates> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
|
||
<record id="res_config_settings_view_form" model="ir.ui.view"> | ||
<field name="name">res.config.settings.view.form</field> | ||
<field name="model">res.config.settings</field> | ||
<field name="inherit_id" ref="point_of_sale.res_config_settings_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div[@id='pos_interface_section']" position="inside"> | ||
<div class="col-12 col-lg-6 o_setting_box"> | ||
<div class="o_setting_left_pane"> | ||
<field name="pos_display_quick_product_info" /> | ||
</div> | ||
<div class="o_setting_right_pane"> | ||
<label for="pos_display_quick_product_info" /> | ||
<div class="text-muted"> | ||
Display product info by one click | ||
</div> | ||
</div> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
1 change: 1 addition & 0 deletions
1
setup/pos_product_quick_info/odoo/addons/pos_product_quick_info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../pos_product_quick_info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |