summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2018-07-13 10:00:44 +0200
committerYannick Tivisse <yti@odoo.com>2018-07-17 17:37:42 +0200
commit3031ab8f0f723cb650188367d0b9892ebb0aafde (patch)
treef0c3d47edd071b770c69cfb23acc385a55befc90
parentb60de0db41bbe4af3c2f6e2369eda5d483702d76 (diff)
[IMP] mrp,purchase,pos: Improve demo data
SPECIFICATIONS ============== PoS --- https://drive.google.com/a/odoo.com/file/d/1BkVVQTR7V_kZpNsOO0CwqTQtxAH9boLB/view?usp=drivesdk Add new products : Cola, Water, Orange Juice (+ images) in internal category : All/Saleable/PoS available in PoS Traceability ------------ The [FURN_9666] Table (MTO) should be tracked by serial number There should be one purchase order already received for 1 Table Top There should be one purchase order already received for 4 Table legs There should be one MO done for the table (consuming the products received in the PO you've created) > The goal is to have a complete traceability report for one table Delete SN/LN : https://drive.google.com/a/odoo.com/file/d/1cxdE-2laGYaZ2rnSFKjEbVg6k6MVyLdw/view?usp=drivesdk Assign crm.lead to the admin user : when opening the pipe, there must be some leads and opportunities Products -------- https://drive.google.com/a/odoo.com/file/d/1qaO7MlufZbj7bw6z5S8DtmKPYiK0sQNK/view?usp=drivesdk route buy should be ticked on pedal bin product remove some ecommerce categories: https://drive.google.com/a/odoo.com/file/d/1sgIJE49BHVDcoF5CXngbJAvWb2fN_3Wk/view?usp=drivesdk
-rw-r--r--addons/mrp/data/mrp_demo.xml16
-rw-r--r--addons/mrp/models/mrp_workorder.py3
-rw-r--r--addons/point_of_sale/data/point_of_sale_data.xml2
-rw-r--r--addons/pos_restaurant/data/pos_restaurant_demo.xml46
-rw-r--r--addons/pos_restaurant/static/img/th-coke.jpgbin0 -> 11357 bytes
-rw-r--r--addons/pos_restaurant/static/img/th-minute_maid.jpgbin0 -> 5585 bytes
-rw-r--r--addons/pos_restaurant/static/img/th-water.jpgbin0 -> 10524 bytes
-rw-r--r--addons/product/data/product_demo.xml2
-rw-r--r--addons/product/tests/test_product_pricelist.py4
-rw-r--r--addons/purchase_mrp/__manifest__.py2
-rw-r--r--addons/purchase_stock/data/purchase_stock_demo.xml3
-rw-r--r--addons/stock/data/stock_demo2.xml11
-rw-r--r--addons/stock/models/stock_production_lot.py2
-rw-r--r--addons/website_sale/data/demo.xml84
-rw-r--r--addons/website_sale_options/static/src/js/website_sale.test.js2
-rw-r--r--addons/website_sale_wishlist/static/src/js/website_sale_tour_wishlist.js12
16 files changed, 66 insertions, 123 deletions
diff --git a/addons/mrp/data/mrp_demo.xml b/addons/mrp/data/mrp_demo.xml
index dd0a3d3f568..cf802539c11 100644
--- a/addons/mrp/data/mrp_demo.xml
+++ b/addons/mrp/data/mrp_demo.xml
@@ -169,6 +169,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description">Solid wood table.</field>
<field name="default_code">FURN_9666</field>
+ <field name="tracking">serial</field>
<field name="image" type="base64" file="mrp/static/img/table.png"/>
</record>
<record id="product_product_computer_desk_head" model="product.product">
@@ -470,18 +471,6 @@
<field name="name">0000000000030</field>
<field name="product_id" ref="product.product_product_27"/>
</record>
- <record id="lot_product_27_1" model="stock.production.lot">
- <field name="name">0000000000031</field>
- <field name="product_id" ref="product.product_product_27"/>
- </record>
- <record id="lot_product_drawer_drawer" model="stock.production.lot">
- <field name="name">0000000000032</field>
- <field name="product_id" ref="product_product_drawer_drawer"/>
- </record>
- <record id="lot_product_drawer_case" model="stock.production.lot">
- <field name="name">0000000000033</field>
- <field name="product_id" ref="product_product_drawer_case"/>
- </record>
<!-- Initital Inventory -->
@@ -503,7 +492,6 @@
<field name="product_uom_id" ref="uom.product_uom_unit"/>
<field name="inventory_id" ref="stock_inventory_drawer"/>
<field name="product_qty">40</field>
- <field name="prod_lot_id" ref="lot_product_27_1"/>
<field name="location_id" ref="stock.stock_location_14"/>
</record>
<record id="stock_inventory_line_product_drawer_drawer" model="stock.inventory.line">
@@ -511,7 +499,6 @@
<field name="product_uom_id" ref="uom.product_uom_unit"/>
<field name="inventory_id" ref="stock_inventory_drawer"/>
<field name="product_qty">50</field>
- <field name="prod_lot_id" ref="lot_product_drawer_drawer"/>
<field name="location_id" ref="stock.stock_location_14"/>
</record>
<record id="stock_inventory_line_product_drawer_case" model="stock.inventory.line">
@@ -519,7 +506,6 @@
<field name="product_uom_id" ref="uom.product_uom_unit"/>
<field name="inventory_id" ref="stock_inventory_drawer"/>
<field name="product_qty">50</field>
- <field name="prod_lot_id" ref="lot_product_drawer_case"/>
<field name="location_id" ref="stock.stock_location_14"/>
</record>
<record id="stock_inventory_line_product_wood_panel" model="stock.inventory.line">
diff --git a/addons/mrp/models/mrp_workorder.py b/addons/mrp/models/mrp_workorder.py
index cc7a98635ea..b58e5eb29f4 100644
--- a/addons/mrp/models/mrp_workorder.py
+++ b/addons/mrp/models/mrp_workorder.py
@@ -305,6 +305,9 @@ class MrpWorkorder(models.Model):
@api.multi
def record_production(self):
+ if not self:
+ return True
+
self.ensure_one()
if self.qty_producing <= 0:
raise UserError(_('Please set the quantity you are currently producing. It should be different from zero.'))
diff --git a/addons/point_of_sale/data/point_of_sale_data.xml b/addons/point_of_sale/data/point_of_sale_data.xml
index 24a0f58e400..eef8edee6ce 100644
--- a/addons/point_of_sale/data/point_of_sale_data.xml
+++ b/addons/point_of_sale/data/point_of_sale_data.xml
@@ -37,7 +37,7 @@
</record>
<record model="pos.config" id="pos_config_main">
- <field name="name">Main</field>
+ <field name="name">Shop</field>
<field name="picking_type_id" ref="picking_type_posout"/>
<field name="barcode_nomenclature_id" ref="barcodes.default_barcode_nomenclature"/>
</record>
diff --git a/addons/pos_restaurant/data/pos_restaurant_demo.xml b/addons/pos_restaurant/data/pos_restaurant_demo.xml
index 69b39eafb63..55a20022b25 100644
--- a/addons/pos_restaurant/data/pos_restaurant_demo.xml
+++ b/addons/pos_restaurant/data/pos_restaurant_demo.xml
@@ -11,9 +11,47 @@
<field name="product_categories_ids" eval="[(6, 0, [ref('point_of_sale.pos_category_miscellaneous')])]" />
</record>
- <!-- Pos Config -->
+ <record id="product_category_pos" model="product.category">
+ <field name="parent_id" ref="product.product_category_1"/>
+ <field name="name">PoS</field>
+ </record>
+
+ <record id="drinks" model="pos.category">
+ <field name="name">Drinks</field>
+ </record>
+
+ <record id="coke" model="product.product">
+ <field name="available_in_pos">True</field>
+ <field name="list_price">2.20</field>
+ <field name="name">Coca-Cola</field>
+ <field name="pos_categ_id" ref="drinks"/>
+ <field name="categ_id" ref="pos_restaurant.product_category_pos"/>
+ <field name="image" type="base64" file="pos_restaurant/static/img/th-coke.jpg"/>
+ </record>
- <record id="point_of_sale.pos_config_main" model="pos.config">
+ <record id="water" model="product.product">
+ <field name="available_in_pos">True</field>
+ <field name="list_price">2.20</field>
+ <field name="name">Water</field>
+ <field name="pos_categ_id" ref="drinks"/>
+ <field name="categ_id" ref="pos_restaurant.product_category_pos"/>
+ <field name="image" type="base64" file="pos_restaurant/static/img/th-water.jpg"/>
+ </record>
+
+ <record id="minute_maid" model="product.product">
+ <field name="available_in_pos">True</field>
+ <field name="list_price">2.20</field>
+ <field name="name">Minute Maid</field>
+ <field name="pos_categ_id" ref="drinks"/>
+ <field name="categ_id" ref="pos_restaurant.product_category_pos"/>
+ <field name="image" type="base64" file="pos_restaurant/static/img/th-minute_maid.jpg"/>
+ </record>
+
+ <!-- Pos Config -->
+ <record model="pos.config" id="pos_config_restaurant">
+ <field name="name">Bar</field>
+ <field name="picking_type_id" ref="point_of_sale.picking_type_posout"/>
+ <field name="barcode_nomenclature_id" ref="barcodes.default_barcode_nomenclature"/>
<field name="module_pos_restaurant">True</field>
<field name="is_table_management">True</field>
<field name="iface_splitbill">True</field>
@@ -27,7 +65,7 @@
<record id="floor_main" model="restaurant.floor">
<field name="name">Main Floor</field>
<field name="background_color">rgb(136,137,242)</field>
- <field name="pos_config_id" eval="ref('point_of_sale.pos_config_main')" />
+ <field name="pos_config_id" eval="ref('pos_restaurant.pos_config_restaurant')" />
</record>
<record id="table_01" model="restaurant.table">
@@ -167,7 +205,7 @@
<record id="floor_patio" model="restaurant.floor">
<field name="name">Patio</field>
<field name="background_color">rgb(130, 233, 171)</field>
- <field name="pos_config_id" eval="ref('point_of_sale.pos_config_main')" />
+ <field name="pos_config_id" eval="ref('pos_restaurant.pos_config_restaurant')" />
</record>
<!-- Patio: Left table row -->
diff --git a/addons/pos_restaurant/static/img/th-coke.jpg b/addons/pos_restaurant/static/img/th-coke.jpg
new file mode 100644
index 00000000000..a8802d0bc83
--- /dev/null
+++ b/addons/pos_restaurant/static/img/th-coke.jpg
Binary files differ
diff --git a/addons/pos_restaurant/static/img/th-minute_maid.jpg b/addons/pos_restaurant/static/img/th-minute_maid.jpg
new file mode 100644
index 00000000000..c3f152db229
--- /dev/null
+++ b/addons/pos_restaurant/static/img/th-minute_maid.jpg
Binary files differ
diff --git a/addons/pos_restaurant/static/img/th-water.jpg b/addons/pos_restaurant/static/img/th-water.jpg
new file mode 100644
index 00000000000..e031e38ba4c
--- /dev/null
+++ b/addons/pos_restaurant/static/img/th-water.jpg
Binary files differ
diff --git a/addons/product/data/product_demo.xml b/addons/product/data/product_demo.xml
index 09756c5a28d..dd730d92904 100644
--- a/addons/product/data/product_demo.xml
+++ b/addons/product/data/product_demo.xml
@@ -159,7 +159,7 @@
</record>
<record id="product_product_4_product_template" model="product.template">
- <field name="name">Desk Customizable</field>
+ <field name="name">Customizable Desk</field>
<field name="categ_id" ref="product_category_5"/>
<field name="standard_price">500.0</field>
<field name="list_price">750.0</field>
diff --git a/addons/product/tests/test_product_pricelist.py b/addons/product/tests/test_product_pricelist.py
index a2ed546cf39..43db6f7c49b 100644
--- a/addons/product/tests/test_product_pricelist.py
+++ b/addons/product/tests/test_product_pricelist.py
@@ -65,11 +65,11 @@ class TestProductPricelist(TransactionCase):
def test_10_calculation_price_of_products_pricelist(self):
"""Test calculation of product price based on pricelist"""
- # I check sale price of Desk Customizable
+ # I check sale price of Customizable Desk
context = {}
context.update({'pricelist': self.customer_pricelist.id, 'quantity': 1})
ipad_retina_display = self.ipad_retina_display.with_context(context)
- msg = "Wrong sale price: Desk Customizable. should be %s instead of %s" % (ipad_retina_display.price, (ipad_retina_display.lst_price-ipad_retina_display.lst_price*(0.10)))
+ msg = "Wrong sale price: Customizable Desk. should be %s instead of %s" % (ipad_retina_display.price, (ipad_retina_display.lst_price-ipad_retina_display.lst_price*(0.10)))
self.assertEqual(float_compare(ipad_retina_display.price, (ipad_retina_display.lst_price-ipad_retina_display.lst_price*(0.10)), precision_digits=2), 0, msg)
# I check sale price of Laptop.
diff --git a/addons/purchase_mrp/__manifest__.py b/addons/purchase_mrp/__manifest__.py
index ce84472e8d9..78e6636355f 100644
--- a/addons/purchase_mrp/__manifest__.py
+++ b/addons/purchase_mrp/__manifest__.py
@@ -15,8 +15,6 @@ from purchase order.
""",
'website': 'https://www.odoo.com/page/manufacturing',
'depends': ['mrp', 'purchase'],
- 'data': [],
- 'demo': [],
'installable': True,
'auto_install': True,
}
diff --git a/addons/purchase_stock/data/purchase_stock_demo.xml b/addons/purchase_stock/data/purchase_stock_demo.xml
index 42b66d63aae..9f61d5f181d 100644
--- a/addons/purchase_stock/data/purchase_stock_demo.xml
+++ b/addons/purchase_stock/data/purchase_stock_demo.xml
@@ -18,6 +18,9 @@
<field name="route_ids" eval="[(4,ref('route_warehouse0_buy'))]"></field>
</record>
+ <record id="product.product_product_9" model="product.product">
+ <field name="route_ids" eval="[(4,ref('route_warehouse0_buy'))]"></field>
+ </record>
</data>
<data noupdate="0">
diff --git a/addons/stock/data/stock_demo2.xml b/addons/stock/data/stock_demo2.xml
index 43186a14195..eb181e16d21 100644
--- a/addons/stock/data/stock_demo2.xml
+++ b/addons/stock/data/stock_demo2.xml
@@ -52,18 +52,13 @@
<field name="image" type="base64" file="stock/static/img/cable_management.png"/>
</record>
- <record id="lot_icecream_0" model="stock.production.lot">
+ <record id="lot_product_cable_management" model="stock.production.lot">
<field name="name">0000000000017</field>
<field name="product_id" ref="stock.product_cable_management_box"/>
</record>
- <record id="lot_icecream_1" model="stock.production.lot">
- <field name="name">0000000000024</field>
- <field name="product_id" ref="stock.product_cable_management_box"/>
- </record>
-
<record id="stock_inventory_icecream" model="stock.inventory">
- <field name="name">Inventory for icecream</field>
+ <field name="name">Inventory for Cable Management Box</field>
<field name="filter">product</field>
<field name="product_id" ref="stock.product_cable_management_box"/>
</record>
@@ -73,7 +68,6 @@
<field name="product_uom_id" ref="uom.product_uom_kgm"/>
<field name="inventory_id" ref="stock.stock_inventory_icecream"/>
<field name="product_qty">50.0</field>
- <field name="prod_lot_id" ref="stock.lot_icecream_0"/>
<field name="location_id" ref="stock.stock_location_14"/>
</record>
@@ -82,7 +76,6 @@
<field name="product_uom_id" ref="uom.product_uom_kgm"/>
<field name="inventory_id" ref="stock.stock_inventory_icecream"/>
<field name="product_qty">40.0</field>
- <field name="prod_lot_id" ref="stock.lot_icecream_1"/>
<field name="location_id" ref="stock.stock_location_14"/>
</record>
diff --git a/addons/stock/models/stock_production_lot.py b/addons/stock/models/stock_production_lot.py
index 5f0009e9504..c34451a73ee 100644
--- a/addons/stock/models/stock_production_lot.py
+++ b/addons/stock/models/stock_production_lot.py
@@ -39,7 +39,7 @@ class ProductionLot(models.Model):
@api.multi
def write(self, vals):
- if 'product_id' in vals:
+ if 'product_id' in vals and any([vals['product_id'] != lot.product_id.id for lot in self]):
move_lines = self.env['stock.move.line'].search([('lot_id', 'in', self.ids)])
if move_lines:
raise UserError(_(
diff --git a/addons/website_sale/data/demo.xml b/addons/website_sale/data/demo.xml
index 55705457947..a61012731c7 100644
--- a/addons/website_sale/data/demo.xml
+++ b/addons/website_sale/data/demo.xml
@@ -135,85 +135,10 @@
<field name="name">Lamps</field>
<field name="sequence">22</field>
</record>
- <record id="public_category_tables" model="product.public.category">
- <field name="name">Tables</field>
- <field name="sequence">23</field>
- </record>
<record id="public_category_multimedia" model="product.public.category">
<field name="name">Multimedia</field>
<field name="sequence">24</field>
</record>
- <record id="devices" model="product.public.category">
- <field name="name">Devices</field>
- <field name="sequence">5</field>
- </record>
-
- <record id="Screen" model="product.public.category">
- <field name="parent_id" ref="devices"/>
- <field name="name">Screen</field>
- <field name="sequence">11</field>
- </record>
- <record id="Pen_Drive" model="product.public.category">
- <field name="parent_id" ref="devices"/>
- <field name="name">Pen Drive</field>
- <field name="sequence">9</field>
- </record>
- <record id="External_Hard_Drive" model="product.public.category">
- <field name="parent_id" ref="devices"/>
- <field name="name">External Hard Drive</field>
- <field name="sequence">6</field>
- </record>
- <record id="Keyboard_Mouse" model="product.public.category">
- <field name="parent_id" ref="devices"/>
- <field name="name">Keyboard / Mouse</field>
- <field name="sequence">8</field>
- </record>
- <record id="printer" model="product.public.category">
- <field name="parent_id" ref="devices"/>
- <field name="name">Printer</field>
- <field name="sequence">10</field>
- </record>
- <record id="Speakers" model="product.public.category">
- <field name="parent_id" ref="devices"/>
- <field name="name">Speakers</field>
- <field name="sequence">13</field>
- </record>
- <record id="Headset" model="product.public.category">
- <field name="parent_id" ref="devices"/>
- <field name="name">Headset</field>
- <field name="sequence">7</field>
- </record>
- <record id="Software" model="product.public.category">
- <field name="parent_id" ref="devices"/>
- <field name="name">Software</field>
- <field name="sequence">12</field>
- </record>
-
- <record id="laptops" model="product.public.category">
- <field name="name">Laptops</field>
- <field name="sequence">1</field>
- </record>
-
- <record id="sub_computers" model="product.public.category">
- <field name="name">Computers</field>
- <field name="sequence">2</field>
- </record>
-
- <record id="Computer_all_in_one" model="product.public.category">
- <field name="parent_id" ref="sub_computers"/>
- <field name="name">Computer all-in-one</field>
- <field name="sequence">3</field>
- </record>
- <record id="server" model="product.public.category">
- <field name="parent_id" ref="sub_computers"/>
- <field name="name">Server</field>
- <field name="sequence">4</field>
- </record>
-
- <record id="network" model="product.public.category">
- <field name="name">Network</field>
- <field name="sequence">14</field>
- </record>
<record id="services" model="product.public.category">
<field name="name">Services</field>
@@ -277,9 +202,6 @@
<record id="product.product_product_27_product_template" model="product.template">
<field name="public_categ_ids" eval="[(6,0,[ref('public_category_drawers')])]"/>
</record>
- <record id="product.product_delivery_02_product_template" model="product.template">
- <field name="public_categ_ids" eval="[(6,0,[ref('External_Hard_Drive')])]"/>
- </record>
<record id="product.product_order_01_product_template" model="product.template">
<field name="public_categ_ids" eval="[(6,0,[ref('public_category_multimedia')])]"/>
</record>
@@ -405,7 +327,7 @@
<record id="website_sale_order_line_2" model="sale.order.line">
<field name="order_id" ref="website_sale_order_2"/>
- <field name="name">Desk Customizable</field>
+ <field name="name">Customizable Desk</field>
<field name="product_id" ref="product.product_product_4"/>
<field name="product_uom_qty">1</field>
<field name="product_uom" ref="uom.product_uom_unit"/>
@@ -426,7 +348,7 @@
<record id="website_sale_order_line_3" model="sale.order.line">
<field name="order_id" ref="website_sale_order_3"/>
- <field name="name">Desk Customizable</field>
+ <field name="name">Customizable Desk</field>
<field name="product_id" ref="product.product_product_4"/>
<field name="product_uom_qty">1</field>
<field name="product_uom" ref="uom.product_uom_unit"/>
@@ -468,7 +390,7 @@
<record id="website_sale_order_line_5" model="sale.order.line">
<field name="order_id" ref="website_sale_order_5"/>
- <field name="name">Desk Customizable</field>
+ <field name="name">Customizable Desk</field>
<field name="product_id" ref="product.product_product_4"/>
<field name="product_uom_qty">3</field>
<field name="product_uom" ref="uom.product_uom_unit"/>
diff --git a/addons/website_sale_options/static/src/js/website_sale.test.js b/addons/website_sale_options/static/src/js/website_sale.test.js
index d1e8f74ce22..ae6e4108647 100644
--- a/addons/website_sale_options/static/src/js/website_sale.test.js
+++ b/addons/website_sale_options/static/src/js/website_sale.test.js
@@ -43,7 +43,7 @@ tour.register('shop_customize', {
{
content: "select product",
extra_trigger: 'body:not(:has(.oe_website_sale .oe_product_cart:eq(2)))',
- trigger: '.oe_product_cart a:contains("Desk Customizable")',
+ trigger: '.oe_product_cart a:contains("Customizable Desk")',
},
{
content: "open customize menu",
diff --git a/addons/website_sale_wishlist/static/src/js/website_sale_tour_wishlist.js b/addons/website_sale_wishlist/static/src/js/website_sale_tour_wishlist.js
index 921bbe32ffd..1728fef9f92 100644
--- a/addons/website_sale_wishlist/static/src/js/website_sale_tour_wishlist.js
+++ b/addons/website_sale_wishlist/static/src/js/website_sale_tour_wishlist.js
@@ -47,18 +47,18 @@ tour.register('shop_wishlist', {
},
},
{
- content: "check that logged in and search for desk customizable",
+ content: "check that logged in and search for Customizable Desk",
extra_trigger: 'li span:contains(Administrator)',
trigger: 'form input[name="search"]',
- run: "text Desk Customizable",
+ run: "text Customizable Desk",
},
{
content: "submit search",
trigger: 'form:has(input[name="search"]) .oe_search_button',
},
{
- content: "click on desk customizable",
- trigger: '.oe_product_cart a:contains("Desk Customizable")',
+ content: "click on Customizable Desk",
+ trigger: '.oe_product_cart a:contains("Customizable Desk")',
},
{
content: "select desk cutomizable",
@@ -75,8 +75,8 @@ tour.register('shop_wishlist', {
trigger: 'a[href="/shop/wishlist"]',
},
{
- content: "remove desk customizable",
- trigger: 'tr:contains("Desk Customizable") a.o_wish_rm:first',
+ content: "remove Customizable Desk",
+ trigger: 'tr:contains("Customizable Desk") a.o_wish_rm:first',
},
{
content: "check that wishlist contains 1 item",