Browse Source

Apr 18 [UPDT] Bug Fixed 'pos_product_create_edit'

dependabot/npm_and_yarn/odoo_website_helpdesk/static/src/cdn/minimist-1.2.8
AjmalCybro 2 years ago
parent
commit
974fc2db6e
  1. 2
      pos_product_create_edit/__manifest__.py
  2. 8
      pos_product_create_edit/doc/RELEASE_NOTES.md
  3. BIN
      pos_product_create_edit/static/description/assets/screenshots/2.jpg
  4. BIN
      pos_product_create_edit/static/description/assets/screenshots/2.png
  5. BIN
      pos_product_create_edit/static/description/assets/screenshots/3.png
  6. BIN
      pos_product_create_edit/static/description/assets/screenshots/4.png
  7. BIN
      pos_product_create_edit/static/description/assets/screenshots/hero.gif
  8. BIN
      pos_product_create_edit/static/description/assets/screenshots/hero.webp
  9. 4
      pos_product_create_edit/static/description/index.html
  10. 4
      pos_product_create_edit/static/src/css/ProductList.css
  11. 8
      pos_product_create_edit/static/src/js/ProductCreatePopup.js
  12. 8
      pos_product_create_edit/static/src/js/ProductEditPopup.js
  13. 34
      pos_product_create_edit/static/src/xml/ProductCreatePopup.xml
  14. 28
      pos_product_create_edit/static/src/xml/ProductEditPopup.xml
  15. 5
      pos_product_create_edit/static/src/xml/ProductLine.xml
  16. 1
      pos_product_create_edit/static/src/xml/ProductListScreen.xml

2
pos_product_create_edit/__manifest__.py

@ -20,7 +20,7 @@
#############################################################################
{
'name': 'Product Create Or Edit From Point of Sale ',
'version': '16.0.1.0.0',
'version': '16.0.1.0.1',
'summary': 'This Module will help to create and edit products directly from point of sale.',
'category': 'Point of Sale',
'author': 'Cybrosys Techno Solutions',

8
pos_product_create_edit/doc/RELEASE_NOTES.md

@ -5,7 +5,7 @@
#### ADD
Initial Commit Product Create & Edit From Point Of Sale
#### 12.04.2023
#### Version 16.0.1.0.1
#### UPDATE
Updated the barcode field and internal reference fields.

BIN
pos_product_create_edit/static/description/assets/screenshots/2.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

BIN
pos_product_create_edit/static/description/assets/screenshots/2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
pos_product_create_edit/static/description/assets/screenshots/3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 124 KiB

BIN
pos_product_create_edit/static/description/assets/screenshots/4.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 112 KiB

BIN
pos_product_create_edit/static/description/assets/screenshots/hero.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

BIN
pos_product_create_edit/static/description/assets/screenshots/hero.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

4
pos_product_create_edit/static/description/index.html

@ -25,7 +25,7 @@
Product Create & Edit From Pos</h1>
<p style="color:#FFFFFF; padding: 8px 15px; text-align: center; font-size: 24px;">You can directly edit or create new product from point of sale.</p>
<!-- END OF APP HERO -->
<img src="assets/screenshots/hero.webp" class="img-responsive"
<img src="assets/screenshots/hero.gif" class="img-responsive"
style="width: 100%; margin-left: auto; margin-right: auto;" />
</div>
</div>
@ -163,7 +163,7 @@
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;"></p>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">On the product screen you can see All products Listed.Each products have a edit button on the right side. By clicking on the button you can edit the product directly from pos.</p>
<img src="assets/screenshots/2.jpg" class="img-thumbnail">
<img src="assets/screenshots/2.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Product Edit popup

4
pos_product_create_edit/static/src/css/ProductList.css

@ -27,8 +27,8 @@ select.form-control{
border: none;
box-shadow: 0px 0px 0px 1px gainsboro inset;
box-sizing: border-box;
width: 75%;
width: 85%;
}
i.fa.fa-plus.create_btn{
margin-right:5px;
}
}

8
pos_product_create_edit/static/src/js/ProductCreatePopup.js

@ -50,6 +50,8 @@ class CreateProductPopup extends AbstractAwaitablePopup {
let price = $("#list_price").val();
let cost = $("#cost_price").val();
let category = $("#product_category").val();
let barcode = $("#barcode").val();
let default_code = $("#default_code").val();
let values = {};
if (base64_img) {
values["image_1920"] = base64_img;
@ -66,6 +68,12 @@ class CreateProductPopup extends AbstractAwaitablePopup {
if (category) {
values["pos_categ_id"] = category;
}
if (barcode) {
values["barcode"] = barcode;
}
if (default_code) {
values["default_code"] = default_code;
}
values["available_in_pos"] = true;
await this.rpc({
model: "product.product",

8
pos_product_create_edit/static/src/js/ProductEditPopup.js

@ -58,6 +58,12 @@ class EditProductPopup extends AbstractAwaitablePopup {
if ($("#product_category").val()) {
values["pos_categ_id"] = parseInt($("#product_category").val());
}
if ($("#barcode").val()) {
values["barcode"] = parseInt($("#barcode").val());
}
if ($("#default_code").val()) {
values["default_code"] = parseInt($("#default_code").val());
}
this.rpc({
model: "product.product",
method: "write",
@ -66,6 +72,8 @@ class EditProductPopup extends AbstractAwaitablePopup {
if (result) {
this.props.product.display_name = $("#display_name").val();
this.props.product.lst_price = $("#list_price").val();
this.props.product.barcode = $("#barcode").val();
this.props.product.default_code = $("#default_code").val();
this.props.product.pos_categ_id = [
parseInt($("#product_category").val()),
$("#product_category")[0].selectedOptions[0].title,

34
pos_product_create_edit/static/src/xml/ProductCreatePopup.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="CreateProductPopup" owl="1">
<div class="popup product-line-popup">
<div class="popup product-line-popup" style="max-width: 684px;">
<main class="body">
<div>
<header>
@ -10,28 +10,36 @@
<i class="fa fa-times" style="float:right" t-on-click="cancel"/>
<hr/>
</h3>
<div class="product-img-create-popup">
<img t-att-src="imageUrl" id="img_url_tag_create"/>
<div class="product-img-create-popup">
<img t-att-src="imageUrl" id="img_url_tag_create"/>
</div>
<div class="field_div">
<label for="img_field" class="field_label">Image</label>
<div class="field_div" style="display:flex; margin-bottom: 15px;">
<label for="img_field" class="field_label" style="margin-right:10px; margin-top: 10px; width: 120px; display: inline-block; text-align: left;">Image</label>
<input type="file" id="img_field" class="field_input" name="img_field"
accept="image/*"/>
</div>
<div class="field_div">
<label for="display_name" class="field_label">Name</label>
<div class="field_div" style="display:flex; margin-bottom: 15px;">
<label for="display_name" class="field_label" style="margin-right:10px; margin-top: 10px; width: 120px; display: inline-block; text-align: left;">Name</label>
<input type="text" name="display_name" class="field_input" id="display_name"/>
</div>
<div class="field_div">
<label for="list_price" class="field_label">Price</label>
<div class="field_div" style="display:flex; margin-bottom: 15px;">
<label for="list_price" class="field_label" style="margin-right:10px; margin-top: 10px; width: 120px; display: inline-block; text-align: left;">Price</label>
<input type="text" name="list_price" class="field_input" id="list_price"/>
</div>
<div class="field_div">
<label for="list_price" class="field_label">Cost</label>
<div class="field_div" style="display:flex; margin-bottom: 15px;">
<label for="list_price" class="field_label" style="margin-right:10px; margin-top: 10px; width: 120px; display: inline-block; text-align: left;">Cost</label>
<input type="text" name="cost_price" class="field_input" id="cost_price"/>
</div>
<div class="field_div" style="display:flex">
<label for="category" class="field_label">Category</label>
<div class="field_div" style="display:flex; margin-bottom: 15px;">
<label for="barcode" class="field_label" style="margin-right:10px; margin-top: 10px; width: 120px; display: inline-block; text-align: left;">Barcode</label>
<input type="text" name="barcode" class="field_input" id="barcode"/>
</div>
<div class="field_div" style="display:flex; margin-bottom: 15px;">
<label for="default_code" class="field_label" style="margin-right:10px; margin-top: 10px; width: 120px; display: inline-block; text-align: left;">Default Code</label>
<input type="text" name="default_code" class="field_input" id="default_code"/>
</div>
<div class="field_div" style="display:flex; margin-bottom: 15px;">
<label for="category" class="field_label" style="margin-right:10px; margin-top: 10px; width: 120px; display: inline-block; text-align: left;">Category</label>
<select name="category" class="form-control" id="product_category">
<t t-foreach="env.pos.db.category_by_id" t-as="category"
t-key="env.pos.db.category_by_id[category].id">

28
pos_product_create_edit/static/src/xml/ProductEditPopup.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="EditProductPopup" owl="1">
<div class="popup product-line-popup">
<div class="popup product-line-popup" style="max-width: 684px;">
<main class="body">
<div>
<header>
@ -14,23 +14,33 @@
<img t-att-src="imageUrl" t-att-alt="props.product.display_name"
id="img_url_tag_edit"/>
</div>
<div class="field_div">
<label for="img_field" class="field_label">Image</label>
<div class="field_div" style="display:flex; margin-bottom: 15px;">
<label for="img_field" class="field_label" style="margin-right:10px; margin-top: 10px; width: 120px; display: inline-block; text-align: left;">Image</label>
<input type="file" id="img_field" class="field_input" name="img_field"
accept="image/*"/>
</div>
<div class="field_div">
<label for="display_name" class="field_label">Name</label>
<div class="field_div" style="display:flex; margin-bottom: 15px;">
<label for="display_name" class="field_label" style="margin-right:10px; margin-top: 10px; width: 120px; display: inline-block; text-align: left;">Name</label>
<input type="text" name="display_name" class="field_input" id="display_name"
t-att-value="props.product.display_name"/>
</div>
<div class="field_div">
<label for="list_price" class="field_label">Price</label>
<div class="field_div" style="display:flex; margin-bottom: 15px;">
<label for="list_price" class="field_label" style="margin-right:10px; margin-top: 10px; width: 120px; display: inline-block; text-align: left;">Price</label>
<input type="text" name="list_price" class="field_input" id="list_price"
t-att-value="props.product.lst_price"/>
</div>
<div class="field_div" style="display:flex">
<label for="category" class="field_label">Category</label>
<div class="field_div" style="display:flex; margin-bottom: 15px;">
<label for="default_code" class="field_label" style="margin-right:10px; margin-top: 10px; width: 120px; display: inline-block; text-align: left;">Default Code</label>
<input type="text" name="default_code" class="field_input" id="default_code"
t-att-value="props.product.default_code"/>
</div>
<div class="field_div" style="display:flex; margin-bottom: 15px;">
<label for="barcode" class="field_label" style="margin-right:10px; margin-top: 10px; width: 120px; display: inline-block; text-align: left;">Barcode</label>
<input type="text" name="barcode" class="field_input" id="barcode"
t-att-value="props.product.barcode"/>
</div>
<div class="field_div" style="display:flex; margin-bottom: 15px;">
<label for="category" class="field_label" style="margin-right:10px; margin-top: 10px; width: 120px; display: inline-block; text-align: left;">Category</label>
<select name="category" class="form-control" id="product_category">
<t t-foreach="env.pos.db.category_by_id" t-as="category"
t-key="env.pos.db.category_by_id[category].id">

5
pos_product_create_edit/static/src/xml/ProductLine.xml

@ -28,6 +28,11 @@
<t t-esc="props.product.lst_price or ''"/>
</div>
</td>
<td t-if="!env.isMobile">
<div>
<t t-esc="props.product.barcode or ''"/>
</div>
</td>
<td>
<div>
<button class="edit_product" t-on-click="editCurrentProduct">

1
pos_product_create_edit/static/src/xml/ProductListScreen.xml

@ -40,6 +40,7 @@
<th t-if="!env.isMobile">Default Code</th>
<th t-if="!env.isMobile" class="partner-line-category">Category</th>
<th t-if="!env.isMobile" class="partner-line-price">List Price</th>
<th t-if="!env.isMobile" class="partner-line-price">Barcode</th>
<th>Edit</th>
</tr>
</thead>

Loading…
Cancel
Save