summaryrefslogtreecommitdiff
path: root/addons/purchase/test
diff options
context:
space:
mode:
authorqdp-odoo <qdp@odoo.com>2015-08-31 16:57:32 +0200
committerqdp-odoo <qdp@odoo.com>2015-08-31 16:57:32 +0200
commite4dc50bf58d508d95b4ce9909af7e0ddfa2e46cf (patch)
tree33fd37e1efec4643112b83a7c4b021746a21a598 /addons/purchase/test
parentce3381aa633ab48723f896ebca5b25e4a51d6f97 (diff)
[IMP] pricelists improvements. Was PR #8228
Diffstat (limited to 'addons/purchase/test')
-rw-r--r--addons/purchase/test/anglo_saxon.yml1
-rw-r--r--addons/purchase/test/anglo_saxon_avg_fifo.yml1
-rw-r--r--addons/purchase/test/average_price.yml3
-rw-r--r--addons/purchase/test/costmethodchange.yml3
-rw-r--r--addons/purchase/test/fifo_price.yml45
-rw-r--r--addons/purchase/test/fifo_returns.yml2
-rw-r--r--addons/purchase/test/process/merge_order.yml1
7 files changed, 12 insertions, 44 deletions
diff --git a/addons/purchase/test/anglo_saxon.yml b/addons/purchase/test/anglo_saxon.yml
index 69aaba6feb2..72e16a0d47f 100644
--- a/addons/purchase/test/anglo_saxon.yml
+++ b/addons/purchase/test/anglo_saxon.yml
@@ -100,7 +100,6 @@
!record {model: purchase.order, id: purchase_order_001}:
partner_id: base.res_partner_3
location_id: stock.stock_location_stock
- pricelist_id: 1
order_line:
- product_id: product.product_product_10
product_qty: 1
diff --git a/addons/purchase/test/anglo_saxon_avg_fifo.yml b/addons/purchase/test/anglo_saxon_avg_fifo.yml
index 8dcde204551..019605e0735 100644
--- a/addons/purchase/test/anglo_saxon_avg_fifo.yml
+++ b/addons/purchase/test/anglo_saxon_avg_fifo.yml
@@ -107,7 +107,6 @@
!record {model: purchase.order, id: purchase_order_001_fifo}:
partner_id: base.res_partner_3
location_id: stock.stock_location_stock
- pricelist_id: 1
order_line:
- product_id: product_fifo_anglo_saxon
product_qty: 1
diff --git a/addons/purchase/test/average_price.yml b/addons/purchase/test/average_price.yml
index f5bb97d95ac..b816e34bcbc 100644
--- a/addons/purchase/test/average_price.yml
+++ b/addons/purchase/test/average_price.yml
@@ -19,7 +19,6 @@
!record {model: purchase.order, id: purchase_order_average1}:
partner_id: base.res_partner_3
location_id: stock.stock_location_stock
- pricelist_id: purchase.list0
order_line:
- product_id: product_average_icecream
product_qty: 10.0
@@ -54,7 +53,6 @@
!record {model: purchase.order, id: purchase_order_average2}:
partner_id: base.res_partner_3
location_id: stock.stock_location_stock
- pricelist_id: purchase.list0
order_line:
- product_id: product_average_icecream
product_qty: 30.0
@@ -109,7 +107,6 @@
!record {model: purchase.order, id: purchase_order_average3}:
partner_id: base.res_partner_3
location_id: stock.stock_location_stock
- pricelist_id: purchase.list0
order_line:
- product_id: product_average_icecream
product_qty: 500.0
diff --git a/addons/purchase/test/costmethodchange.yml b/addons/purchase/test/costmethodchange.yml
index 7d6879cdc74..dccf5ee10c5 100644
--- a/addons/purchase/test/costmethodchange.yml
+++ b/addons/purchase/test/costmethodchange.yml
@@ -20,7 +20,6 @@
!record {model: purchase.order, id: purchase_order_variable1}:
partner_id: base.res_partner_3
location_id: stock.stock_location_stock
- pricelist_id: 1
order_line:
- product_id: product_variable_icecream
product_qty: 10.0
@@ -33,7 +32,6 @@
!record {model: purchase.order, id: purchase_order_variable2}:
partner_id: base.res_partner_3
location_id: stock.stock_location_stock
- pricelist_id: 1
order_line:
- product_id: product_variable_icecream
product_qty: 30.0
@@ -116,7 +114,6 @@
!record {model: purchase.order, id: purchase_order_variable3}:
partner_id: base.res_partner_3
location_id: stock.stock_location_stock
- pricelist_id: 1
order_line:
- product_id: product_variable_icecream
product_qty: 20.0
diff --git a/addons/purchase/test/fifo_price.yml b/addons/purchase/test/fifo_price.yml
index 7b4eba4a93b..05d87991489 100644
--- a/addons/purchase/test/fifo_price.yml
+++ b/addons/purchase/test/fifo_price.yml
@@ -4,9 +4,6 @@
!record {model: res.company, id: base.main_company}:
currency_id: base.EUR
-
- !record {model: product.pricelist, id: purchase.list0}:
- currency_id: base.EUR
--
Set a product as using fifo price
-
!record {model: product.product, id: product_fifo_icecream}:
@@ -28,8 +25,8 @@
-
!record {model: purchase.order, id: purchase_order_fifo1}:
partner_id: base.res_partner_3
+ currency_id: base.EUR
location_id: stock.stock_location_stock
- pricelist_id: purchase.list0
order_line:
- product_id: product_fifo_icecream
product_qty: 10.0
@@ -62,7 +59,6 @@
!record {model: purchase.order, id: purchase_order_fifo2}:
partner_id: base.res_partner_3
location_id: stock.stock_location_stock
- pricelist_id: purchase.list0
order_line:
- product_id: product_fifo_icecream
product_qty: 30.0
@@ -151,35 +147,20 @@
-
We will temporarily change the currency rate on the sixth of June to have the same results all year
-
- !record {model: res.currency.rate, id: base.rateUSDbis}:
- rate: 1.2834
- currency_id: base.USD
- name: !eval time.strftime('%Y-06-06')
--
- Create new pricelist in usd
--
- !record {model: product.pricelist, id: supplier_pricelist_usd}:
- name: Vendor Pricelist
- type: purchase
- currency_id: base.USD
- version_id:
- - name: v1.0
- items_id:
- - name: First version
- sequence: 1
- price_min_margin: 2
- price_max_margin: 5
- product_id: product_fifo_icecream
- base: !eval (ref('product.standard_price'))
--
- Purchase order in usd
+ Purchase order in USD
+-
+ !record {model: res.currency, id: new_USD}:
+ name: new_usd
+ rate_ids:
+ - rate: 1.2834
+ name: !eval time.strftime('%Y-%m-%d')
-
I create a draft Purchase Order for 30000 g at 0.150 USD/g and 10 kg at 150 USD/kg
-
!record {model: purchase.order, id: purchase_order_fifo_usd}:
partner_id: base.res_partner_3
+ currency_id: new_USD
location_id: stock.stock_location_stock
- pricelist_id: supplier_pricelist_usd
order_line:
- product_id: product_fifo_icecream
product_qty: 30000
@@ -228,11 +209,11 @@
picking_obj = self.pool.get('stock.picking').browse(cr, uid, ref("outgoing_fifo_shipment_cur"), context=context)
picking_obj.do_transfer()
-
- Check rounded price is 102 euro (because last outgoing shipment was made of 19.5kg at 80€ and 30kg at $150 (rate=1.2834)
+ Check rounded price is 102 euro (because last outgoing shipment was made of 19.5kg at 80€ and 30kg at $150 (rate=1.2834)
-
!python {model: product.product}: |
assert round(self.browse(cr, uid, ref("product_fifo_icecream")).standard_price) == 102, "Product price not updated accordingly. %s found instead of 102 (rounded values)" %(round(self.browse(cr, uid, ref("product_fifo_icecream")).standard_price),)
--
+-
Do a delivery of an extra 10 kg
-
!record {model: stock.picking, id: outgoing_fifo_shipment_ret}:
@@ -266,7 +247,7 @@
product = self.browse(cr, uid, ref("product_fifo_icecream"))
assert round(product.standard_price) == round(150.0 / 1.2834), "Product price not updated accordingly. %s found instead of %s" %(product.standard_price, round(150.0/1.2834))
assert product.qty_available == 0.0, 'Wrong quantity in stock after first reception'
--
+-
Let us create some outs to get negative stock for a new product using the same config
-
!record {model: product.product, id: product_fifo_negative}:
@@ -340,7 +321,6 @@
!record {model: purchase.order, id: purchase_order_fifo_neg}:
partner_id: base.res_partner_3
location_id: stock.stock_location_stock
- pricelist_id: purchase.list0
order_line:
- product_id: product_fifo_negative
product_qty: 50.0
@@ -369,7 +349,6 @@
!record {model: purchase.order, id: purchase_order_fifo_neg2}:
partner_id: base.res_partner_3
location_id: stock.stock_location_stock
- pricelist_id: purchase.list0
order_line:
- product_id: product_fifo_negative
product_qty: 60.0
diff --git a/addons/purchase/test/fifo_returns.yml b/addons/purchase/test/fifo_returns.yml
index 6be83f0f8bf..77ba3984715 100644
--- a/addons/purchase/test/fifo_returns.yml
+++ b/addons/purchase/test/fifo_returns.yml
@@ -20,7 +20,6 @@
!record {model: purchase.order, id: purchase_order_fiforet1}:
partner_id: base.res_partner_3
location_id: stock.stock_location_stock
- pricelist_id: purchase.list0
order_line:
- product_id: product_fiforet_icecream
product_qty: 10.0
@@ -33,7 +32,6 @@
!record {model: purchase.order, id: purchase_order_fiforet2}:
partner_id: base.res_partner_3
location_id: stock.stock_location_stock
- pricelist_id: purchase.list0
order_line:
- product_id: product_fiforet_icecream
product_qty: 30.0
diff --git a/addons/purchase/test/process/merge_order.yml b/addons/purchase/test/process/merge_order.yml
index bbb84b0507f..591556a6981 100644
--- a/addons/purchase/test/process/merge_order.yml
+++ b/addons/purchase/test/process/merge_order.yml
@@ -29,7 +29,6 @@
for order in self.browse(cr, uid, new_id.keys()):
assert order.state == 'draft',"New created order state should be in draft"
assert order.partner_id == order3.partner_id ,"partner is not correspond"
- assert order.pricelist_id == order3.pricelist_id,"Price list is not correspond"
assert order.location_id == order3.location_id ,"Location is not correspond"
total_new_qty = sum(x.product_qty for x in order.order_line)