-
-
+
diff --git a/addons/project_mrp/__openerp__.py b/addons/project_mrp/__openerp__.py
index ee5a94208aa..a51a95c5d16 100644
--- a/addons/project_mrp/__openerp__.py
+++ b/addons/project_mrp/__openerp__.py
@@ -47,12 +47,13 @@ automatically created via sale orders.
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
- 'depends': ['project', 'mrp_procurement', 'sale', 'mrp_jit'],
+ 'depends': ['project', 'procurement', 'sale', 'mrp_jit'],
'init_xml': [],
'update_xml': ['project_mrp_workflow.xml',
#'process/project_mrp_process.xml',
],
'demo_xml': [],
+ 'test': ['test/project_task_procurement.yml'],
'installable': True,
'active': False,
'certificate': '0031976495453',
diff --git a/addons/project_mrp/mrp.py b/addons/project_mrp/mrp.py
index 6287ca3ad30..98b05248a66 100644
--- a/addons/project_mrp/mrp.py
+++ b/addons/project_mrp/mrp.py
@@ -22,9 +22,9 @@
from osv import fields, osv, orm
import tools
-class mrp_procurement(osv.osv):
- _name = "mrp.procurement"
- _inherit = "mrp.procurement"
+class procurement_order(osv.osv):
+ _name = "procurement.order"
+ _inherit = "procurement.order"
def action_produce_assign_service(self, cr, uid, ids, context={}):
for procurement in self.browse(cr, uid, ids):
@@ -91,7 +91,7 @@ class mrp_procurement(osv.osv):
'project_id': project_id,
},context=context)
return task_id
-mrp_procurement()
+procurement_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_mrp/project_mrp.py b/addons/project_mrp/project_mrp.py
index 8029327022d..b606bbfe8fa 100644
--- a/addons/project_mrp/project_mrp.py
+++ b/addons/project_mrp/project_mrp.py
@@ -26,7 +26,7 @@ class project_task(osv.osv):
_name = "project.task"
_inherit = "project.task"
_columns = {
- 'procurement_id': fields.many2one('mrp.procurement', 'Procurement', ondelete='set null')
+ 'procurement_id': fields.many2one('procurement.order', 'Procurement', ondelete='set null')
}
def do_close(self, cr, uid, ids, *args):
@@ -35,7 +35,7 @@ class project_task(osv.osv):
for task in tasks:
if task.procurement_id:
wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'mrp.procurement', task.procurement_id.id, 'subflow.done', cr)
+ wf_service.trg_validate(uid, 'procurement.order', task.procurement_id.id, 'subflow.done', cr)
return res
def do_cancel(self, cr, uid, ids, *args):
@@ -44,7 +44,7 @@ class project_task(osv.osv):
for task in tasks:
if task.procurement_id:
wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'mrp.procurement', task.procurement_id.id, 'subflow.cancel', cr)
+ wf_service.trg_validate(uid, 'procurement.order', task.procurement_id.id, 'subflow.cancel', cr)
return True
project_task()
diff --git a/addons/project_mrp/project_mrp_workflow.xml b/addons/project_mrp/project_mrp_workflow.xml
index 43217d69f83..cd242e7f699 100644
--- a/addons/project_mrp/project_mrp_workflow.xml
+++ b/addons/project_mrp/project_mrp_workflow.xml
@@ -1,9 +1,9 @@
-
-
-
+
+
+ subflow.done
diff --git a/addons/project_mrp/security/ir.model.access.csv b/addons/project_mrp/security/ir.model.access.csv
index 407ab3716a0..7c6e2a7a30c 100644
--- a/addons/project_mrp/security/ir.model.access.csv
+++ b/addons/project_mrp/security/ir.model.access.csv
@@ -1,3 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_mrp_procurement_project_user","mrp.procurement project_user","model_mrp_procurement","project.group_project_user",1,1,1,1
-"access_mrp_procurement_project_manager","mrp.procurement project_manager","model_mrp_procurement","project.group_project_manager",1,1,1,1
+"access_procurement_project_user","procurement.order project_user","model_procurement_order","project.group_project_user",1,1,1,1
+"access_procurement_project_manager","procurement.order project_manager","model_procurement_order","project.group_project_manager",1,1,1,1
diff --git a/addons/project_mrp/test/project_task_procurement.yml b/addons/project_mrp/test/project_task_procurement.yml
new file mode 100644
index 00000000000..50bc74f82ae
--- /dev/null
+++ b/addons/project_mrp/test/project_task_procurement.yml
@@ -0,0 +1,75 @@
+-
+ In order to test project_mrp module with OpenERP I want to create sale orders
+ with product type 'service' so when procurement runs one task is created.
+-
+ I create record for a service type product.
+-
+ !record {model: product.product, id: product_product_partnerstraining0}:
+ categ_id: product.product_category_7
+ cost_method: standard
+ mes_type: fixed
+ name: Partners Training
+ procure_method: make_to_order
+ supply_method: produce
+ type: service
+ uom_id: product.uom_day
+ uom_po_id: product.uom_day
+ warranty: 0.0
+-
+ I create a sale order for product Partners Training which has type 'Service'.
+-
+ !record {model: sale.order, id: sale_order_so0}:
+ date_order: '2010-05-21'
+ invoice_quantity: order
+ name: SO006
+ order_policy: manual
+ partner_id: base.res_partner_asus
+ partner_invoice_id: base.res_partner_address_tang
+ partner_order_id: base.res_partner_address_tang
+ partner_shipping_id: base.res_partner_address_tang
+ order_line:
+ - state: draft
+ delay: 7.0
+ name: Partners Training
+ price_unit: 1.0
+ product_id: product_product_partnerstraining0
+ product_uom: product.uom_day
+ product_uom_qty: 5.0
+ th_weight: 0.0
+ type: make_to_order
+ picking_policy: direct
+ pricelist_id: product.list0
+ shop_id: sale.shop
+ user_id: base.user_demo
+-
+ I confirm this sale order.
+-
+ !workflow {model: sale.order, action: order_confirm, ref: sale_order_so0}
+-
+ I check the procurements.
+-
+ !python {model: procurement.order}: |
+ from tools.translate import _
+ orderline_obj = self.pool.get('sale.order.line')
+ line_ids = orderline_obj.search(cr, uid, [('order_id','=', ref('sale_order_so0'))])
+ orders = orderline_obj.browse(cr, uid, line_ids)
+ proc_ids = map(lambda x: x.procurement_id.id, orders)
+ assert proc_ids, _('No Procurements!')
+-
+ The scheduler runs.
+-
+ !function {model: procurement.order, name: run_scheduler}:
+ - model: procurement.order
+ search: "[('state','=','confirmed')]"
+-
+ Now I check the tasks.
+-
+ I see that one task is created for my sale order.
+-
+ !python {model: project.task}: |
+ from tools.translate import _
+ order_obj = self.pool.get('sale.order')
+ order = order_obj.browse(cr, uid, ref('sale_order_so0'))
+ task_id = self.search(cr, uid, [('project_id.name','=', order.name)])
+ assert task_id, _('No Task is created!')
+
\ No newline at end of file
diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py
index e172e5e73f1..8d3d213a91d 100644
--- a/addons/purchase/__openerp__.py
+++ b/addons/purchase/__openerp__.py
@@ -31,7 +31,7 @@
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
- 'depends': ['base', 'account', 'stock', 'process', 'mrp_procurement'],
+ 'depends': ['base', 'account', 'stock', 'process', 'procurement'],
'init_xml': [],
'update_xml': [
diff --git a/addons/purchase/i18n/et.po b/addons/purchase/i18n/et.po
index c967f8e0d2b..072ed95902f 100644
--- a/addons/purchase/i18n/et.po
+++ b/addons/purchase/i18n/et.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-10 03:36+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase
diff --git a/addons/purchase/i18n/pl.po b/addons/purchase/i18n/pl.po
index 09a529c020e..bc24632a606 100644
--- a/addons/purchase/i18n/pl.po
+++ b/addons/purchase/i18n/pl.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index 2cfd4247bcf..08507f9dfac 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -698,8 +698,8 @@ class purchase_order_line(osv.osv):
return True
purchase_order_line()
-class mrp_procurement(osv.osv):
- _inherit = 'mrp.procurement'
+class procurement_order(osv.osv):
+ _inherit = 'procurement.order'
_columns = {
'purchase_id': fields.many2one('purchase.order', 'Latest Requisition'),
}
@@ -779,7 +779,7 @@ class mrp_procurement(osv.osv):
res[procurement.id] = purchase_id
self.write(cr, uid, [procurement.id], {'state': 'running', 'purchase_id': purchase_id})
return res
-mrp_procurement()
+procurement_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index 17fd47b7012..502c33bd5f9 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -21,8 +21,6 @@
parent="base.menu_purchase_root" sequence="4"/>
-
@@ -353,9 +351,9 @@
-->
- mrp.procurement.form.inherit
- mrp.procurement
-
+ procurement.order.form.inherit
+ procurement.order
+ form
diff --git a/addons/purchase/purchase_workflow.xml b/addons/purchase/purchase_workflow.xml
index d7684be1875..d14530e5f48 100644
--- a/addons/purchase/purchase_workflow.xml
+++ b/addons/purchase/purchase_workflow.xml
@@ -180,7 +180,7 @@
-
+ buysubflow
@@ -188,20 +188,20 @@
-
+ check_buy()
-
+ subflow.delivery_done
-
+ subflow.cancel
diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py
index 71f2638d628..ff3d4bdcee8 100644
--- a/addons/purchase/report/purchase_report.py
+++ b/addons/purchase/report/purchase_report.py
@@ -69,7 +69,7 @@ class purchase_report(osv.osv):
'quantity': fields.float('# of Products', readonly=True),
'price_total': fields.float('Total Price', readonly=True),
'price_average': fields.float('Average Price', readonly=True),
- 'nbr': fields.integer('# of Lines', readonly=True),
+ 'nbr': fields.integer('# of Ordered Lines', readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
@@ -106,7 +106,7 @@ class purchase_report(osv.osv):
extract(epoch from age(s.date_approve,s.date_order))/(24*60*60)::decimal(16,2) as delay,
extract(epoch from age(s.minimum_planned_date,s.date_order))/(24*60*60)::decimal(16,2) as delay_pass,
count(*) as nbr,
- sum(l.product_qty*l.price_unit) as price_total,
+ l.price_unit*l.product_qty*u.factor as price_total,
(sum(l.product_qty*l.price_unit)/sum(l.product_qty*u.factor))::decimal(16,2) as price_average
from purchase_order s
left join purchase_order_line l on (s.id=l.order_id)
@@ -118,7 +118,10 @@ class purchase_report(osv.osv):
s.shipped,
l.invoiced,
s.partner_id,
+ l.product_qty,
+ u.factor,
s.location_id,
+ l.price_unit,
s.date_approve,
s.minimum_planned_date,
date_trunc('day',s.minimum_planned_date),
diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml
index 468f3892a13..db6cc6273de 100644
--- a/addons/purchase/report/purchase_report_view.xml
+++ b/addons/purchase/report/purchase_report_view.xml
@@ -26,7 +26,6 @@
-
@@ -35,9 +34,10 @@
+
-
+
diff --git a/addons/purchase/test/purchase_from_manual.yml b/addons/purchase/test/purchase_from_manual.yml
index e0b1a8b806c..e7a608b7557 100644
--- a/addons/purchase/test/purchase_from_manual.yml
+++ b/addons/purchase/test/purchase_from_manual.yml
@@ -1,5 +1,5 @@
-
- In order to test the purchase flow,I start by creating a new product 'iPod'
+ In order to test the purchase flow,I start by creating a new product 'iPod'
-
!record {model: product.product, id: product_product_ipod0}:
categ_id: 'product.product_category_3'
@@ -22,14 +22,14 @@
weight: 0.0
weight_net: 0.0
-
- In order to test the purchase flow,I create a new record where "invoice_method" is From Manual
+ In order to test the purchase flow,I create a new record where "invoice_method" is From Manual
-
- Creating an purchase.order record
+ I create purchase order for iPod.
-
!record {model: purchase.order, id: purchase_order_po1}:
company_id: base.main_company
date_order: '2010-05-11'
- invoice_method: order
+ invoice_method: manual
location_id: stock.stock_location_stock
name: PO00010
order_line:
@@ -44,26 +44,21 @@
partner_id: base.res_partner_4
pricelist_id: purchase.list0
-
- Initially purchase order is in the draft state
+ Initially purchase order is in the draft state
-
!assert {model: purchase.order, id: purchase_order_po1}:
- state == 'draft'
-
- Then an order is confirmed by clicking on the "Confirm Purchase Order" button
--
- !python {model: purchase.order}: |
- self.wkf_confirm_order(cr, uid, [ref("purchase_order_po1")])
--
- Performing a workflow action purchase_confirm on module purchase.order
+ I confirm the purchase order.
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po1}
-
- I check that the order which was initially in the draft state has transit to confirm state.
+ I check that the order which was initially in the draft state has transit to confirm state.
-
!assert {model: purchase.order, id: purchase_order_po1}:
- state == 'confirmed'
-
- I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
+ I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -72,14 +67,14 @@
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name) ])
assert search_ids, _('Purchase order line is not created!')
-
- To check that wizard "Create Invoices" gets opened
+ To check that wizard "Create Invoices" gets opened
-
- Creating a purchase.order.line_invoice record
+ I create purchase order line invoice entry.
-
!record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}:
{}
-
- Performing an osv_memory action makeInvoices on module purchase.order.line_invoice
+ I create invoice for products in the purchase order.
-
!python {model: purchase.order.line_invoice}: |
pur_obj=self.pool.get('purchase.order')
@@ -89,7 +84,7 @@
ids.append(line.id)
self.makeInvoices(cr, uid, [1], context={'active_ids': ids})
-
- I check that invoice gets created
+ I check that invoice gets created.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -98,7 +93,7 @@
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name),('invoiced', '=', '1') ])
assert search_ids, _('Invoice is not created!')
-
- I check that a record gets created in the Pending Invoices
+ I check that a record gets created in the Pending Invoices.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -107,33 +102,28 @@
ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)])
assert ids, _('Pending Invoice is not created!')
-
- Then an order is approved by clicking on the "Approved by Supplier" button
--
- !python {model: purchase.order}: |
- self.wkf_approve_order(cr, uid, [ref("purchase_order_po1")])
--
- Performing a workflow action purchase_approve on module purchase.order
+ Supplier approve the purchase order.
-
!workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po1}
-
- I check that the order which was initially in the confirmed state has transit to approved state.
+ I check that the order which was initially in the confirmed state has transit to approved state.
-
!assert {model: purchase.order, id: purchase_order_po1}:
- state == 'approved'
-
- I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved
+ I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po1"))
assert(pur_id.date_approve)
-
- I check that an entry gets created in the stock.picking
+ I check that an entry gets created in the stock pickings.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po1"))
assert(pur_id.picking_ids)
-
- I check that an entry gets created in the stock.move
+ I check that an entry gets created in the stock moves.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -145,4 +135,4 @@
search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)])
assert search_id, _('No Incoming Product!')
-
- I check that Traceability moves are created
+ I check that Traceability moves are created.
diff --git a/addons/purchase/test/purchase_from_order.yml b/addons/purchase/test/purchase_from_order.yml
index 3e83fc7dfda..a13c687c4a5 100644
--- a/addons/purchase/test/purchase_from_order.yml
+++ b/addons/purchase/test/purchase_from_order.yml
@@ -1,5 +1,5 @@
-
- In order to test the purchase flow,I start by creating a new product 'iPod'
+ In order to test the purchase flow,I start by creating a new product 'iPod'
-
!record {model: product.product, id: product_product_ipod0}:
categ_id: 'product.product_category_3'
@@ -22,9 +22,9 @@
weight: 0.0
weight_net: 0.0
-
- In order to test the purchase flow,I create a new record where "invoice_method" is From Order
+ In order to test the purchase flow,I create a new record where "invoice_method" is From Order.
-
- Creating a purchase.order record
+ I create purchase order for iPod.
-
!record {model: purchase.order, id: purchase_order_po0}:
company_id: base.main_company
@@ -44,26 +44,21 @@
partner_id: base.res_partner_4
pricelist_id: purchase.list0
-
- Initially purchase order is in the draft state
+ Initially purchase order is in the draft state.
-
!assert {model: purchase.order, id: purchase_order_po0}:
- state == 'draft'
-
- Then an order is confirmed by clicking on the "Confirm Purchase Order" button
--
- !python {model: purchase.order}: |
- self.wkf_confirm_order(cr, uid, [ref("purchase_order_po0")])
--
- Performing a workflow action purchase_confirm on module purchase.order
+ I confirm the purchase order for iPod.
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po0}
-
- I check that the order which was initially in the draft state has transit to confirm state.
+ I check that the order which was initially in the draft state has transit to confirm state.
-
!assert {model: purchase.order, id: purchase_order_po0}:
- state == 'confirmed'
-
- I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
+ I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -72,14 +67,14 @@
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name) ])
assert search_ids, _('Purchase order line is not created!')
-
- To check that wizard "Create Invoices" gets called
+ To check that wizard "Create Invoices" gets called.
-
- Creating a purchase.order.line_invoice record
+ I create purchase order line invoice entry.
-
!record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}:
{}
-
- Performing an osv_memory action makeInvoices on module purchase.order.line_invoice
+ I create invoice for products in the purchase order.
-
!python {model: purchase.order.line_invoice}: |
pur_obj=self.pool.get('purchase.order')
@@ -89,7 +84,7 @@
ids.append(line.id)
self.makeInvoices(cr, uid, [1], context={'active_ids': ids})
-
- I check that invoice gets created
+ I check that invoice gets created.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -98,7 +93,7 @@
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name),('invoiced', '=', '1') ])
assert search_ids, _('Invoice is not created!')
-
- I check that a record gets created in the Pending Invoices
+ I check that a record gets created in the Pending Invoices.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -107,33 +102,28 @@
ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)])
assert ids, _('Pending Invoice is not created!')
-
- Then an order is approved by clicking on the "Approved by Supplier" button
--
- !python {model: purchase.order}: |
- self.wkf_approve_order(cr, uid, [ref("purchase_order_po0")])
--
- Performing a workflow action purchase_approve on module purchase.order
+ Supplier approve the purchase order.
-
!workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po0}
-
- I check that the order which was initially in the confirmed state has transit to approved state.
+ I check that the order which was initially in the confirmed state has transit to approved state.
-
!assert {model: purchase.order, id: purchase_order_po0}:
- state == 'approved'
-
- I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved
+ I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po0"))
assert(pur_id.date_approve)
-
- I check that an entry gets created in the stock.picking
+ I check that an entry gets created in the pickings.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po0"))
assert(pur_id.picking_ids)
-
- I check that an entry gets created in the stock.move
+ I check that an entry gets created in the stock moves.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -145,9 +135,9 @@
search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)])
assert search_id, _('No Incoming Product!')
-
- I check that Traceability moves are created
+ I check that Traceability moves are created.
-
- I check that an invoice_id field of Delivery&Invoices gets bind with the value
+ I check that an invoice_id field of Delivery&Invoices gets bind with the value.
-
!python {model: purchase.order}: |
pur_id2=self.browse(cr, uid, ref("purchase_order_po0"))
diff --git a/addons/purchase/test/purchase_from_picking.yml b/addons/purchase/test/purchase_from_picking.yml
index f4e9628985d..6250772a872 100644
--- a/addons/purchase/test/purchase_from_picking.yml
+++ b/addons/purchase/test/purchase_from_picking.yml
@@ -1,5 +1,5 @@
-
- In order to test the purchase flow,I start by creating a new product 'iPod'
+ In order to test the purchase flow,I start by creating a new product 'iPod'
-
!record {model: product.product, id: product_product_ipod0}:
categ_id: 'product.product_category_3'
@@ -22,9 +22,9 @@
weight: 0.0
weight_net: 0.0
-
- In order to test the purchase flow,I create a new record where "invoice_method" is From Picking
+ In order to test the purchase flow,I create a new record where "invoice_method" is From Picking
-
- Creating an purchase.order record
+ I create purchase order for iPod.
-
!record {model: purchase.order, id: purchase_order_po2}:
company_id: base.main_company
@@ -44,17 +44,12 @@
partner_id: base.res_partner_4
pricelist_id: purchase.list0
-
- Initially purchase order is in the draft state
+ Initially purchase order is in the draft state.
-
!assert {model: purchase.order, id: purchase_order_po2}:
- state == 'draft'
-
- Then an order is confirmed by clicking on the "Confirm Purchase Order" button
--
- !python {model: purchase.order}: |
- self.wkf_confirm_order(cr, uid, [ref("purchase_order_po2")])
--
- Performing a workflow action purchase_confirm on module purchase.order
+ I confirm the purchase order for iPod.
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po2}
-
@@ -63,7 +58,7 @@
!assert {model: purchase.order, id: purchase_order_po2}:
- state == 'confirmed'
-
- I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
+ I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -72,14 +67,14 @@
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name) ])
assert search_ids, _('Purchase order line is not created!')
-
- To check that wizard "Create Invoices" gets opened
+ To check that wizard "Create Invoices" gets opened.
-
- Creating a purchase.order.line_invoice record
+ I create purchase order line invoice entry.
-
!record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}:
{}
-
- Performing an osv_memory action makeInvoices on module purchase.order.line_invoice
+ I create invoice for products in the purchase order.
-
!python {model: purchase.order.line_invoice}: |
pur_obj=self.pool.get('purchase.order')
@@ -89,7 +84,7 @@
ids.append(line.id)
self.makeInvoices(cr, uid, [1], context={'active_ids': ids})
-
- I check that invoice gets created
+ I check that invoice gets created.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -98,7 +93,7 @@
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name),('invoiced', '=', '1') ])
assert search_ids, _('Invoice is not created!')
-
- I check that a record gets created in the Pending Invoices
+ I check that a record gets created in the Pending Invoices.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -107,12 +102,7 @@
ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)])
assert ids, _('Pending Invoice is not created!')
-
- Then an order is approved by clicking on the "Approved by Supplier" button
--
- !python {model: purchase.order}: |
- self.wkf_approve_order(cr, uid, [ref("purchase_order_po2")])
--
- Performing a workflow action purchase_approve on module purchase.order
+ Supplier approve the purchase order.
-
!workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po2}
-
@@ -121,19 +111,19 @@
!assert {model: purchase.order, id: purchase_order_po2}:
- state == 'approved'
-
- I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved
+ I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po2"))
assert(pur_id.date_approve)
-
- I check that an entry gets created in the stock.picking
+ I check that an entry gets created in the stock.picking.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po2"))
assert(pur_id.picking_ids)
-
- I check that an entry gets created in the stock.move
+ I check that an entry gets created related to stock move.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -145,18 +135,18 @@
search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)])
assert search_id, _('No Incoming Product!')
-
- I check that Traceability moves are created
+ I check that Traceability moves are created.
-
- Then I create an invoice from picking by clicking on "Create Invoice" wizard
+ Then I create an invoice from picking by clicking on "Create Invoice" wizard
-
- Creating a stock.invoice.onshipping record
+ I create stock invoice on shipping entry.
-
!record {model: stock.invoice.onshipping, id: stock_invoice_onshipping_0}:
invoice_date: '2010-05-11'
journal_id: account.bank_journal
type: in_invoice
-
- Performing an osv_memory action create_invoice on module stock.invoice.onshipping
+ I create Invoice.
-
!python {model: stock.invoice.onshipping}: |
pur_obj=self.pool.get('purchase.order')
@@ -167,7 +157,7 @@
"tz": False, "search_default_approved": 1, "active_model": "stock.picking",
"active_ids": ids, "active_id": ids[0], })
-
- I check that an invoice_id field of Delivery&Invoices gets bind with the value
+ I check that an invoice_id field of Delivery&Invoices gets bind with the value.
-
!python {model: purchase.order}: |
pur_id2=self.browse(cr, uid, ref("purchase_order_po2"))
diff --git a/addons/purchase_requisition/purchase_requisition.py b/addons/purchase_requisition/purchase_requisition.py
index 85c35b277c5..5aaf3a995e2 100644
--- a/addons/purchase_requisition/purchase_requisition.py
+++ b/addons/purchase_requisition/purchase_requisition.py
@@ -136,11 +136,11 @@ class product_product(osv.osv):
product_product()
-class mrp_procurement(osv.osv):
- _inherit = 'mrp.procurement'
+class procurement_order(osv.osv):
+ _inherit = 'procurement.order'
def make_po(self, cr, uid, ids, context={}):
sequence_obj=self.pool.get('ir.sequence')
- res = super(mrp_procurement, self).make_po(cr, uid, ids, context)
+ res = super(procurement_order, self).make_po(cr, uid, ids, context)
for proc_id,po_id in res.items():
procurement = self.browse(cr, uid, proc_id)
if procurement.product_id.purchase_requisition:
@@ -157,4 +157,4 @@ class mrp_procurement(osv.osv):
'purchase_ids': [(6,0,[po_id])]
})
return res
-mrp_procurement()
+procurement_order()
diff --git a/addons/purchase_requisition/test/purchase_requisition.yml b/addons/purchase_requisition/test/purchase_requisition.yml
index 8983d238e0e..0ace2312034 100644
--- a/addons/purchase_requisition/test/purchase_requisition.yml
+++ b/addons/purchase_requisition/test/purchase_requisition.yml
@@ -59,8 +59,8 @@
-
I launch he scheduler to compute all procurements, and specify all requisitions orders.
-
- !python {model: mrp.procurement.compute.all}: |
- proc_obj = self.pool.get('mrp.procurement')
+ !python {model: procurement.order.compute.all}: |
+ proc_obj = self.pool.get('procurement.order')
proc_obj._procure_confirm(cr,uid)
-
On the purchase tender, I create a new purchase order for the supplier 'DistriPC' by clicking on
diff --git a/addons/purchase_requisition/test/purchase_requisition_exclusive.yml b/addons/purchase_requisition/test/purchase_requisition_exclusive.yml
index e2cba67fca9..641fd740de3 100644
--- a/addons/purchase_requisition/test/purchase_requisition_exclusive.yml
+++ b/addons/purchase_requisition/test/purchase_requisition_exclusive.yml
@@ -52,8 +52,8 @@
-
I launch he scheduler to compute all procurements, and planify all requisitions orders.
-
- !python {model: mrp.procurement.compute.all}: |
- proc_obj = self.pool.get('mrp.procurement')
+ !python {model: procurement.order.compute.all}: |
+ proc_obj = self.pool.get('procurement.order')
proc_obj._procure_confirm(cr,uid)
-
I should find a purchase requisition with the origin 'TEST/TENDER/0002', that includes a request for
diff --git a/addons/report_account/i18n/hr.po b/addons/report_account/i18n/hr.po
index 62dde41d6fc..cf3556f5c74 100644
--- a/addons/report_account/i18n/hr.po
+++ b/addons/report_account/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_analytic/i18n/hr.po b/addons/report_analytic/i18n/hr.po
index 0f1647f8d06..38a2e3a382a 100644
--- a/addons/report_analytic/i18n/hr.po
+++ b/addons/report_analytic/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_analytic_planning/i18n/hr.po b/addons/report_analytic_planning/i18n/hr.po
index 245730b21cd..e8c68bf5c95 100644
--- a/addons/report_analytic_planning/i18n/hr.po
+++ b/addons/report_analytic_planning/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_document/i18n/hr.po b/addons/report_document/i18n/hr.po
index ac73360d8b3..84ad5969b7f 100644
--- a/addons/report_document/i18n/hr.po
+++ b/addons/report_document/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:36+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_intrastat/i18n/hr.po b/addons/report_intrastat/i18n/hr.po
index c9ecd125a04..94f017514f4 100644
--- a/addons/report_intrastat/i18n/hr.po
+++ b/addons/report_intrastat/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_project/i18n/hr.po b/addons/report_project/i18n/hr.po
index a40056a4f50..3f4f33b86c3 100644
--- a/addons/report_project/i18n/hr.po
+++ b/addons/report_project/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_purchase/i18n/hr.po b/addons/report_purchase/i18n/hr.po
index 0dc383bac14..8d921c1f990 100644
--- a/addons/report_purchase/i18n/hr.po
+++ b/addons/report_purchase/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_purchase/i18n/ko.po b/addons/report_purchase/i18n/ko.po
index 4bdec1193dd..3fc2f47e73f 100644
--- a/addons/report_purchase/i18n/ko.po
+++ b/addons/report_purchase/i18n/ko.po
@@ -14,7 +14,11 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+<<<<<<< TREE
+"X-Launchpad-Export-Date: 2010-04-07 03:46+0000\n"
+=======
"X-Launchpad-Export-Date: 2010-04-17 03:54+0000\n"
+>>>>>>> MERGE-SOURCE
"X-Generator: Launchpad (build Unknown)\n"
#. module: report_purchase
diff --git a/addons/report_sale/i18n/hr.po b/addons/report_sale/i18n/hr.po
index aa5adc5fe71..796a3eccf62 100644
--- a/addons/report_sale/i18n/hr.po
+++ b/addons/report_sale/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_task/i18n/es.po b/addons/report_task/i18n/es.po
index 0b134a26c2f..5e5b4fc41ad 100644
--- a/addons/report_task/i18n/es.po
+++ b/addons/report_task/i18n/es.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-10 03:36+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: report_task
diff --git a/addons/sale/__init__.py b/addons/sale/__init__.py
index 71f33623c55..3ad30a6233e 100644
--- a/addons/sale/__init__.py
+++ b/addons/sale/__init__.py
@@ -26,7 +26,6 @@
import sale
import stock
import product
-#import mrp
import wizard
import report
import company
diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py
index 651945752a7..2f265b3d6f7 100644
--- a/addons/sale/__openerp__.py
+++ b/addons/sale/__openerp__.py
@@ -42,7 +42,7 @@
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
- 'depends': ['product', 'stock', 'mrp_procurement', 'process'],
+ 'depends': ['product', 'stock', 'procurement', 'process'],
'init_xml': [],
'update_xml': [
'wizard/sale_make_invoice_advance.xml',
@@ -65,6 +65,8 @@
'test/shipping_manual_sale_order.yml',
'test/prepaid_sale_order.yml',
'test/advance_invoice.yml',
+ 'test/so_make_line_invoice.yml',
+ 'test/so_make_invoice.yml',
'test/sale_procurement.yml',
],
'installable': True,
diff --git a/addons/sale/i18n/ca.po b/addons/sale/i18n/ca.po
index a39cac7c03f..ceaf026717a 100644
--- a/addons/sale/i18n/ca.po
+++ b/addons/sale/i18n/ca.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: sale
diff --git a/addons/sale/i18n/hr.po b/addons/sale/i18n/hr.po
index b947fd04fd9..a00233e6ac7 100644
--- a/addons/sale/i18n/hr.po
+++ b/addons/sale/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/sale/process/sale_process.xml b/addons/sale/process/sale_process.xml
index 58e4be14d84..1ebbc267de7 100644
--- a/addons/sale/process/sale_process.xml
+++ b/addons/sale/process/sale_process.xml
@@ -35,7 +35,7 @@
-
+
@@ -63,12 +63,12 @@
-
-
+
+
-
+
@@ -202,7 +202,7 @@
-
+
diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py
index 68f50068ec0..b47d59e5400 100644
--- a/addons/sale/report/sale_report.py
+++ b/addons/sale/report/sale_report.py
@@ -41,8 +41,12 @@ class sale_report(osv.osv):
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
+
+ 'uom_id': fields.many2one('product.uom', 'Default Unit Of Measure', readonly=True),
+ 'product_qty':fields.float('# of Qty', readonly=True),
'uom_name': fields.char('Default UoM', size=128, readonly=True),
'product_uom_qty':fields.float('# of Qty', readonly=True),
+
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
'shop_id':fields.many2one('sale.shop', 'Shop', readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 07c66ef91dc..4b6c766b671 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -112,7 +112,7 @@ class sale_order(osv.osv):
LEFT JOIN
stock_picking p on (p.id=m.picking_id)
LEFT JOIN
- mrp_procurement mp on (mp.move_id=m.id)
+ procurement_order mp on (mp.move_id=m.id)
WHERE
p.sale_id = ANY(%s) GROUP BY mp.state, p.sale_id''',(ids,))
for oid, nbr, mp_state in cr.fetchall():
@@ -658,7 +658,7 @@ class sale_order(osv.osv):
'note': line.notes,
'company_id': order.company_id.id,
})
- proc_id = self.pool.get('mrp.procurement').create(cr, uid, {
+ proc_id = self.pool.get('procurement.order').create(cr, uid, {
'name': order.name,
'origin': order.name,
'date_planned': date_planned,
@@ -676,10 +676,10 @@ class sale_order(osv.osv):
'company_id': order.company_id.id,
})
wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
+ wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id})
elif line.product_id and line.product_id.product_tmpl_id.type == 'service':
- proc_id = self.pool.get('mrp.procurement').create(cr, uid, {
+ proc_id = self.pool.get('procurement.order').create(cr, uid, {
'name': line.name,
'origin': order.name,
'date_planned': date_planned,
@@ -693,7 +693,7 @@ class sale_order(osv.osv):
})
self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id})
wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
+ wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
else:
#
# No procurement because no product in the sale.order.line.
@@ -807,7 +807,7 @@ class sale_order_line(osv.osv):
'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], change_default=True),
'invoice_lines': fields.many2many('account.invoice.line', 'sale_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True),
'invoiced': fields.boolean('Invoiced', readonly=True),
- 'procurement_id': fields.many2one('mrp.procurement', 'Procurement'),
+ 'procurement_id': fields.many2one('procurement.order', 'Procurement'),
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Sale Price'), readonly=True, states={'draft':[('readonly',False)]}),
'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute= dp.get_precision('Sale Price')),
'tax_id': fields.many2many('account.tax', 'sale_order_tax', 'order_line_id', 'tax_id', 'Taxes', readonly=True, states={'draft':[('readonly',False)]}),
@@ -856,7 +856,7 @@ class sale_order_line(osv.osv):
return line.product_uos_qty or 0.0
return line.product_uom_qty
else:
- return self.pool.get('mrp.procurement').quantity_get(cr, uid,
+ return self.pool.get('procurement.order').quantity_get(cr, uid,
line.procurement_id.id, context=context)
def _get_line_uom(line):
@@ -865,7 +865,7 @@ class sale_order_line(osv.osv):
return line.product_uos.id
return line.product_uom.id
else:
- return self.pool.get('mrp.procurement').uom_get(cr, uid,
+ return self.pool.get('procurement.order').uom_get(cr, uid,
line.procurement_id.id, context=context)
create_ids = []
diff --git a/addons/sale/sale_demo.xml b/addons/sale/sale_demo.xml
index d6ab6a7bc0c..0920cdeebb2 100644
--- a/addons/sale/sale_demo.xml
+++ b/addons/sale/sale_demo.xml
@@ -206,7 +206,7 @@
-
+
diff --git a/addons/sale/sale_unit_test.xml b/addons/sale/sale_unit_test.xml
index dc507edb4a0..95a23024412 100644
--- a/addons/sale/sale_unit_test.xml
+++ b/addons/sale/sale_unit_test.xml
@@ -112,7 +112,7 @@
-
+ done
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index c236b669580..c2139bf617b 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -111,7 +111,7 @@
-
+
@@ -130,6 +130,7 @@
name="product_uom_qty"
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position, True)"
/>
+
-
+
+
@@ -367,6 +369,7 @@
+
diff --git a/addons/sale/sale_workflow.xml b/addons/sale/sale_workflow.xml
index 213605929ba..effe7cb6fff 100644
--- a/addons/sale/sale_workflow.xml
+++ b/addons/sale/sale_workflow.xml
@@ -218,7 +218,7 @@
- mrp.procurement
+ procurement.orderprocurement_lines_get()test_state('finished')
@@ -226,7 +226,7 @@
test_state('canceled')
diff --git a/addons/sale/security/ir.model.access.csv b/addons/sale/security/ir.model.access.csv
index 7af8c1e74a7..de0f55b80b1 100644
--- a/addons/sale/security/ir.model.access.csv
+++ b/addons/sale/security/ir.model.access.csv
@@ -11,7 +11,7 @@
"access_account_analytic_account_salesman","account_analytic_account salesman","analytic.model_account_analytic_account","group_sale_user",1,1,1,1
"access_stock_picking_salesman","stock_picking salesman","stock.model_stock_picking","group_sale_user",1,1,1,1
"access_stock_move_salesman","stock_move salesman","stock.model_stock_move","group_sale_user",1,1,1,0
-"access_mrp_procurement_salesman","mrp.procurement salesman","mrp_procurement.model_mrp_procurement","group_sale_user",1,1,1,1
+"access_procurement_salesman","procurement.order salesman","procurement.model_procurement_order","group_sale_user",1,1,1,1
"access_sale_order_stock_worker","sale.order stock worker","model_sale_order","stock.group_stock_user",1,1,0,0
"access_sale_order_line_stock_worker","sale.order.line stock worker","model_sale_order_line","stock.group_stock_user",1,1,0,0
"access_sale_order_manager","sale.order.manager","model_sale_order","group_sale_manager",1,1,1,1
diff --git a/addons/sale/test/sale_procurement.yml b/addons/sale/test/sale_procurement.yml
index c9d26baec9f..33ba22667ec 100644
--- a/addons/sale/test/sale_procurement.yml
+++ b/addons/sale/test/sale_procurement.yml
@@ -3,6 +3,8 @@
products with different supply method and procurement method.
-
I create two products.
+-
+ I create one product Table.
-
!record {model: product.product, id: product_product_table0}:
categ_id: product.cat1
@@ -12,6 +14,8 @@
type: product
uom_id: product.product_uom_unit
uom_po_id: product.product_uom_unit
+-
+ I create another product Wood.
-
!record {model: product.product, id: product_product_wood0}:
categ_id: product.cat1
@@ -68,21 +72,21 @@
-
I check that one procurement is generated.
-
- !python {model: mrp.procurement}: |
+ !python {model: procurement.order}: |
from tools.translate import _
proc_ids = self.search(cr, uid, [('state','=','confirmed')])
assert proc_ids, _('No Procurements!')
-
The scheduler runs.
-
- !function {model: mrp.procurement, name: run_scheduler}:
- - model: mrp.procurement
+ !function {model: procurement.order, name: run_scheduler}:
+ - model: procurement.order
search: "[('state','=','confirmed')]"
-
I check that the procurement for the product table is in exception state.
As my product's supply method is produce and mrp module is yet not installed.
-
- !python {model: mrp.procurement}: |
+ !python {model: procurement.order}: |
from tools.translate import _
proc_ids = self.search(cr, uid, [('state','=','exception')])
assert proc_ids, _('No Procurements are in exception state!')
diff --git a/addons/sale/test/shipping_manual_sale_order.yml b/addons/sale/test/shipping_manual_sale_order.yml
index 4bbbbb74dc5..c030a80c64a 100644
--- a/addons/sale/test/shipping_manual_sale_order.yml
+++ b/addons/sale/test/shipping_manual_sale_order.yml
@@ -211,7 +211,7 @@
!record {model: product.category, id: product_category_services0}:
name: Mobile Services
-
- I define LG Viewty Smart product template.
+ I define New Chocolate Slider Mobile template.
-
!record {model: product.template, id: product_template_newchocolateslidermobile0}:
categ_id: product_category_allproductssellable0
@@ -226,7 +226,7 @@
uom_id: product.product_uom_unit
uom_po_id: product.product_uom_unit
-
- I define LG Viewty Smart product.
+ I define New Chocolate Slider Mobile.
-
!record {model: product.product, id: product_product_newchocolateslidermobile0}:
categ_id: product_category_allproductssellable0
diff --git a/addons/sale/test/so_make_invoice.yml b/addons/sale/test/so_make_invoice.yml
new file mode 100644
index 00000000000..e34b11ffb2b
--- /dev/null
+++ b/addons/sale/test/so_make_invoice.yml
@@ -0,0 +1,341 @@
+-
+ In order to test the sale module in the Open-ERP, I need to configure details regarding product & customer.
+-
+ I am going to sell my Mobile products to the customer with name Cleartrail
+-
+ I create View Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_view0}:
+ close_method: none
+ code: View
+ name: View
+ sign: 1
+-
+ I create Income Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_income0}:
+ close_method: unreconciled
+ code: Income
+ name: Income
+ sign: 1
+-
+ I create Expense Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_expense0}:
+ close_method: unreconciled
+ code: Expense
+ name: Expense
+ sign: 1
+-
+ I create Cash Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_cash0}:
+ close_method: balance
+ code: Cash
+ name: Cash
+ sign: 1
+-
+ I create Minimal Chart Account.
+-
+ !record {model: account.account, id: account_account_minimalchart0}:
+ code: '0'
+ company_id: base.main_company
+ currency_mode: current
+ name: Minimal Chart
+ parent_left: 1
+ parent_right: 12
+ type: view
+ user_type: account_account_type_view0
+-
+ I create Payable Account.
+-
+ !record {model: account.account, id: account_account_payable1}:
+ code: AP
+ company_id: base.main_company
+ currency_mode: current
+ name: Payable
+ parent_id: account_account_minimalchart0
+ parent_left: 2
+ parent_right: 3
+ reconcile: true
+ type: payable
+ user_type: account_account_type_expense0
+-
+ I create Receivable Account.
+-
+ !record {model: account.account, id: account_account_receivable0}:
+ code: AR
+ company_id: base.main_company
+ currency_mode: current
+ name: Receivable
+ parent_id: account_account_minimalchart0
+ parent_left: 4
+ parent_right: 5
+ reconcile: true
+ type: receivable
+ user_type: account_account_type_income0
+-
+ I create Cash Account.
+-
+ !record {model: account.account, id: account_account_cash0}:
+ code: C
+ company_id: base.main_company
+ currency_mode: current
+ name: Cash
+ parent_id: account_account_minimalchart0
+ parent_left: 6
+ parent_right: 7
+ type: other
+ user_type: account_account_type_cash0
+-
+ I create Purchases Account.
+-
+ !record {model: account.account, id: account_account_purchases0}:
+ code: P
+ company_id: base.main_company
+ currency_mode: current
+ name: Purchases
+ parent_id: account_account_minimalchart0
+ parent_left: 8
+ parent_right: 9
+ type: other
+ user_type: account_account_type_expense0
+-
+ I create Sales Account.
+-
+ !record {model: account.account, id: account_account_sales0}:
+ code: S
+ company_id: base.main_company
+ currency_mode: current
+ name: Sales
+ parent_id: account_account_minimalchart0
+ parent_left: 10
+ parent_right: 11
+ type: other
+ user_type: account_account_type_income0
+-
+ I create Purchase Journal.
+-
+ !record {model: account.journal, id: account_journal_purchasejournal0}:
+ code: PUJ
+ company_id: base.main_company
+ default_credit_account_id: account_account_purchases0
+ default_debit_account_id: account_account_purchases0
+ name: Purchase Journal
+ sequence_id: account.sequence_purchase_journal
+ type: purchase
+ view_id: account.account_journal_view
+-
+ I create Sale Journal.
+-
+ !record {model: account.journal, id: account_journal_salejournal0}:
+ code: SAJ
+ company_id: base.main_company
+ default_credit_account_id: account_account_sales0
+ default_debit_account_id: account_account_sales0
+ name: Sale Journal
+ sequence_id: account.sequence_sale_journal
+ type: sale
+ view_id: account.account_journal_view
+-
+ I create Bank Journal.
+-
+ !record {model: account.journal, id: account_journal_bankjournal0}:
+ code: BNK
+ company_id: base.main_company
+ default_credit_account_id: account_account_cash0
+ default_debit_account_id: account_account_cash0
+ name: Bank Journal
+ sequence_id: account.sequence_journal
+ type: cash
+ view_id: account.account_journal_bank_view
+-
+ I create ir.property for account payable.
+-
+ !record {model: ir.property, id: ir_property_propertyaccountexpensecateg0}:
+ company_id: base.main_company
+ fields_id: account.field_res_partner_property_account_payable
+ name: property_account_expense_categ
+ value_reference: account.account,5
+-
+ I create ir.property for account receivable.
+-
+ !record {model: ir.property, id: ir_property_propertyaccountincomecateg0}:
+ company_id: base.main_company
+ fields_id: account.field_res_partner_property_account_receivable
+ name: property_account_income_categ
+ value_reference: account.account,6
+-
+ I create Partner category Customers.
+-
+ !record {model: res.partner.category, id: res_partner_category_customers0}:
+ name: Customers
+-
+ I create Cleartrail Customer.
+-
+ !record {model: res.partner, id: res_partner_cleartrail0}:
+ category_id:
+ - res_partner_category_customers0
+ name: Cleartrail
+-
+ I create contact address for Cleartrail.
+-
+ !record {model: res.partner.address, id: res_partner_address_1}:
+ partner_id: res_partner_cleartrail0
+ street: onam plaza, 14 B palasia A B Road
+ type: contact
+-
+ I create invoice address for Cleartrail.
+-
+ !record {model: res.partner.address, id: res_partner_address_2}:
+ partner_id: res_partner_cleartrail0
+ street: sarda house 24 B palasia, A B Road
+ type: invoice
+-
+ I create delivery address for Cleartrail.
+-
+ !record {model: res.partner.address, id: res_partner_address_3}:
+ partner_id: res_partner_cleartrail0
+ street: sangam house 15 B palasia, A B Road
+ type: delivery
+-
+ Customer Cleartrail has specific instrument requirement regarding the stockable products.
+-
+ I define product category Mobile Products Sellable.
+-
+ !record {model: product.category, id: product_category_allproductssellable0}:
+ name: Mobile Products Sellable
+-
+ I define product category Mobile Services.
+-
+ !record {model: product.category, id: product_category_services0}:
+ name: Mobile Services
+-
+ I define LG Viewty Smart product template.
+-
+ !record {model: product.template, id: product_template_lgviewtysmart0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 170.0
+ mes_type: fixed
+ name: LG Viewty Smart
+ procure_method: make_to_order
+ standard_price: 160.0
+ supply_method: produce
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I define LG Viewty Smart product.
+-
+ !record {model: product.product, id: product_product_lgviewtysmart0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 170.0
+ mes_type: fixed
+ name: LG Viewty Smart
+ pricelist_purchase: 'Default Purchase Pricelist (0.00) : 160.00\n'
+ pricelist_sale: 'Public Pricelist (0.00) : 170.00\n'
+ procure_method: make_to_order
+ property_account_expense: sale.account_account_payable1
+ property_account_income: sale.account_account_receivable0
+ seller_delay: '1'
+ standard_price: 160.0
+ supply_method: produce
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I define New Chocolate Slider Mobile template.
+-
+ !record {model: product.template, id: product_template_newchocolateslidermobile0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 200.0
+ mes_type: fixed
+ name: New Chocolate Slider Mobile
+ procure_method: make_to_order
+ standard_price: 189.0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I define New Chocolate Slider Mobile.
+-
+ !record {model: product.product, id: product_product_newchocolateslidermobile0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 200.0
+ mes_type: fixed
+ name: New Chocolate Slider Mobile
+ pricelist_purchase: 'Default Purchase Pricelist (0.00) : 189.00\n'
+ pricelist_sale: 'Public Pricelist (0.00) : 200.00\n'
+ procure_method: make_to_order
+ property_account_expense: sale.account_account_payable1
+ property_account_income: sale.account_account_receivable0
+ seller_delay: '1'
+ standard_price: 189.0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I create a Sale Order for LG Viewty Smart for qty 500 having order_policy manual.
+-
+ !record {model: sale.order, id: sale_order_so4}:
+ date_order: '2010-05-12'
+ invoice_quantity: order
+ name: Test_SO004
+ order_line:
+ - name: New Chocolate Slider Mobile
+ price_unit: 200.0
+ product_uom: product.product_uom_unit
+ product_uom_qty: 500.0
+ state: draft
+ delay: 7.0
+ product_id: sale.product_product_newchocolateslidermobile0
+ product_uos_qty: 500.0
+ type: make_to_order
+ - name: LG Viewty Smart
+ price_unit: 170.0
+ product_uom: product.product_uom_unit
+ product_uom_qty: 500.0
+ state: draft
+ delay: 7.0
+ product_id: sale.product_product_lgviewtysmart0
+ product_uos_qty: 500.0
+ th_weight: 0.0
+ type: make_to_order
+ order_policy: manual
+ partner_id: sale.res_partner_cleartrail0
+ partner_invoice_id: sale.res_partner_address_2
+ partner_order_id: sale.res_partner_address_1
+ partner_shipping_id: sale.res_partner_address_3
+ picking_policy: direct
+ pricelist_id: product.list0
+ shop_id: sale.shop
+-
+ I confirm the Sale Order.
+-
+ !workflow {model: sale.order, action: order_confirm, ref: sale_order_so4}
+-
+ I create an invoice on sale order.
+-
+ !record {model: sale.make.invoice, id: sale_make_invoice_1}:
+ {}
+-
+ Invoice is created for specific sale order.
+-
+ !python {model: sale.make.invoice}: |
+ self.make_invoices(cr, uid, [ref("sale_make_invoice_1")], {"lang": 'en_US', "search_default_user_id":
+ 1, "tz": False, "active_model": 'sale.order', "active_ids": [ref("sale_order_so4")], "active_id":
+ ref("sale_order_so4"), })
+-
+ I verify that invoice regarding sale order has been created.
+-
+ !python {model: sale.order}: |
+ so = self.browse(cr, uid, ref("sale_order_so4"))
+ assert so.invoice_ids, "Invoices has not been generated for sale_order_so0"
+
+
\ No newline at end of file
diff --git a/addons/sale/test/so_make_line_invoice.yml b/addons/sale/test/so_make_line_invoice.yml
new file mode 100644
index 00000000000..de5782c8517
--- /dev/null
+++ b/addons/sale/test/so_make_line_invoice.yml
@@ -0,0 +1,342 @@
+-
+ In order to test the sale module in the Open-ERP, I need to configure details regarding product & customer.
+-
+ I am going to sell my Mobile products to the customer with name Cleartrail
+-
+ I create View Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_view0}:
+ close_method: none
+ code: View
+ name: View
+ sign: 1
+-
+ I create Income Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_income0}:
+ close_method: unreconciled
+ code: Income
+ name: Income
+ sign: 1
+-
+ I create Expense Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_expense0}:
+ close_method: unreconciled
+ code: Expense
+ name: Expense
+ sign: 1
+-
+ I create Cash Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_cash0}:
+ close_method: balance
+ code: Cash
+ name: Cash
+ sign: 1
+-
+ I create Minimal Chart Account.
+-
+ !record {model: account.account, id: account_account_minimalchart0}:
+ code: '0'
+ company_id: base.main_company
+ currency_mode: current
+ name: Minimal Chart
+ parent_left: 1
+ parent_right: 12
+ type: view
+ user_type: account_account_type_view0
+-
+ I create Payable Account.
+-
+ !record {model: account.account, id: account_account_payable1}:
+ code: AP
+ company_id: base.main_company
+ currency_mode: current
+ name: Payable
+ parent_id: account_account_minimalchart0
+ parent_left: 2
+ parent_right: 3
+ reconcile: true
+ type: payable
+ user_type: account_account_type_expense0
+-
+ I create Receivable Account.
+-
+ !record {model: account.account, id: account_account_receivable0}:
+ code: AR
+ company_id: base.main_company
+ currency_mode: current
+ name: Receivable
+ parent_id: account_account_minimalchart0
+ parent_left: 4
+ parent_right: 5
+ reconcile: true
+ type: receivable
+ user_type: account_account_type_income0
+-
+ I create Cash Account.
+-
+ !record {model: account.account, id: account_account_cash0}:
+ code: C
+ company_id: base.main_company
+ currency_mode: current
+ name: Cash
+ parent_id: account_account_minimalchart0
+ parent_left: 6
+ parent_right: 7
+ type: other
+ user_type: account_account_type_cash0
+-
+ I create Purchases Account.
+-
+ !record {model: account.account, id: account_account_purchases0}:
+ code: P
+ company_id: base.main_company
+ currency_mode: current
+ name: Purchases
+ parent_id: account_account_minimalchart0
+ parent_left: 8
+ parent_right: 9
+ type: other
+ user_type: account_account_type_expense0
+-
+ I create Sales Account.
+-
+ !record {model: account.account, id: account_account_sales0}:
+ code: S
+ company_id: base.main_company
+ currency_mode: current
+ name: Sales
+ parent_id: account_account_minimalchart0
+ parent_left: 10
+ parent_right: 11
+ type: other
+ user_type: account_account_type_income0
+-
+ I create Purchase Journal.
+-
+ !record {model: account.journal, id: account_journal_purchasejournal0}:
+ code: PUJ
+ company_id: base.main_company
+ default_credit_account_id: account_account_purchases0
+ default_debit_account_id: account_account_purchases0
+ name: Purchase Journal
+ sequence_id: account.sequence_purchase_journal
+ type: purchase
+ view_id: account.account_journal_view
+-
+ I create Sale Journal.
+-
+ !record {model: account.journal, id: account_journal_salejournal0}:
+ code: SAJ
+ company_id: base.main_company
+ default_credit_account_id: account_account_sales0
+ default_debit_account_id: account_account_sales0
+ name: Sale Journal
+ sequence_id: account.sequence_sale_journal
+ type: sale
+ view_id: account.account_journal_view
+-
+ I create Bank Journal.
+-
+ !record {model: account.journal, id: account_journal_bankjournal0}:
+ code: BNK
+ company_id: base.main_company
+ default_credit_account_id: account_account_cash0
+ default_debit_account_id: account_account_cash0
+ name: Bank Journal
+ sequence_id: account.sequence_journal
+ type: cash
+ view_id: account.account_journal_bank_view
+-
+ I create ir.property for account payable.
+-
+ !record {model: ir.property, id: ir_property_propertyaccountexpensecateg0}:
+ company_id: base.main_company
+ fields_id: account.field_res_partner_property_account_payable
+ name: property_account_expense_categ
+ value_reference: account.account,5
+-
+ I create ir.property for account receivable.
+-
+ !record {model: ir.property, id: ir_property_propertyaccountincomecateg0}:
+ company_id: base.main_company
+ fields_id: account.field_res_partner_property_account_receivable
+ name: property_account_income_categ
+ value_reference: account.account,6
+-
+ I create Partner category Customers.
+-
+ !record {model: res.partner.category, id: res_partner_category_customers0}:
+ name: Customers
+-
+ I create Cleartrail Customer.
+-
+ !record {model: res.partner, id: res_partner_cleartrail0}:
+ category_id:
+ - res_partner_category_customers0
+ name: Cleartrail
+-
+ I create contact address for Cleartrail.
+-
+ !record {model: res.partner.address, id: res_partner_address_1}:
+ partner_id: res_partner_cleartrail0
+ street: onam plaza, 14 B palasia A B Road
+ type: contact
+-
+ I create invoice address for Cleartrail.
+-
+ !record {model: res.partner.address, id: res_partner_address_2}:
+ partner_id: res_partner_cleartrail0
+ street: sarda house 24 B palasia, A B Road
+ type: invoice
+-
+ I create delivery address for Cleartrail.
+-
+ !record {model: res.partner.address, id: res_partner_address_3}:
+ partner_id: res_partner_cleartrail0
+ street: sangam house 15 B palasia, A B Road
+ type: delivery
+-
+ Customer Cleartrail has specific instrument requirement regarding the stockable products.
+-
+ I define product category Mobile Products Sellable.
+-
+ !record {model: product.category, id: product_category_allproductssellable0}:
+ name: Mobile Products Sellable
+-
+ I define product category Mobile Services.
+-
+ !record {model: product.category, id: product_category_services0}:
+ name: Mobile Services
+-
+ I define LG Viewty Smart product template.
+-
+ !record {model: product.template, id: product_template_lgviewtysmart0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 170.0
+ mes_type: fixed
+ name: LG Viewty Smart
+ procure_method: make_to_order
+ standard_price: 160.0
+ supply_method: produce
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I define LG Viewty Smart product.
+-
+ !record {model: product.product, id: product_product_lgviewtysmart0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 170.0
+ mes_type: fixed
+ name: LG Viewty Smart
+ pricelist_purchase: 'Default Purchase Pricelist (0.00) : 160.00\n'
+ pricelist_sale: 'Public Pricelist (0.00) : 170.00\n'
+ procure_method: make_to_order
+ property_account_expense: sale.account_account_payable1
+ property_account_income: sale.account_account_receivable0
+ seller_delay: '1'
+ standard_price: 160.0
+ supply_method: produce
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I define New Chocolate Slider Mobile template.
+-
+ !record {model: product.template, id: product_template_newchocolateslidermobile0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 200.0
+ mes_type: fixed
+ name: New Chocolate Slider Mobile
+ procure_method: make_to_order
+ standard_price: 189.0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I define New Chocolate Slider Mobile.
+-
+ !record {model: product.product, id: product_product_newchocolateslidermobile0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 200.0
+ mes_type: fixed
+ name: New Chocolate Slider Mobile
+ pricelist_purchase: 'Default Purchase Pricelist (0.00) : 189.00\n'
+ pricelist_sale: 'Public Pricelist (0.00) : 200.00\n'
+ procure_method: make_to_order
+ property_account_expense: sale.account_account_payable1
+ property_account_income: sale.account_account_receivable0
+ seller_delay: '1'
+ standard_price: 189.0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I create a Sale Order for LG Viewty Smart for qty 500 having order_policy manual.
+-
+ !record {model: sale.order, id: sale_order_so3}:
+ date_order: '2010-05-12'
+ invoice_quantity: order
+ name: Test_SO003
+ order_line:
+ - name: New Chocolate Slider Mobile
+ price_unit: 200.0
+ product_uom: product.product_uom_unit
+ product_uom_qty: 500.0
+ state: draft
+ delay: 7.0
+ product_id: sale.product_product_newchocolateslidermobile0
+ product_uos_qty: 500.0
+ type: make_to_order
+ - name: LG Viewty Smart
+ price_unit: 170.0
+ product_uom: product.product_uom_unit
+ product_uom_qty: 500.0
+ state: draft
+ delay: 7.0
+ product_id: sale.product_product_lgviewtysmart0
+ product_uos_qty: 500.0
+ th_weight: 0.0
+ type: make_to_order
+ order_policy: manual
+ partner_id: sale.res_partner_cleartrail0
+ partner_invoice_id: sale.res_partner_address_2
+ partner_order_id: sale.res_partner_address_1
+ partner_shipping_id: sale.res_partner_address_3
+ picking_policy: direct
+ pricelist_id: product.list0
+ shop_id: sale.shop
+-
+ I confirm the Sale Order.
+-
+ !workflow {model: sale.order, action: order_confirm, ref: sale_order_so3}
+-
+ I create an invoice on sale order line.
+-
+ !record {model: sale.order.line.make.invoice, id: sale_order_line_make_invoice_0}:
+ {}
+-
+ invoice is created for specific sale order line.
+-
+ !python {model: sale.order.line.make.invoice}: |
+ sale_order_obj = self.pool.get('sale.order')
+ so = sale_order_obj.browse(cr, uid, ref("sale_order_so3"))
+ sol = so.order_line[0]
+ self.make_invoices(cr, uid, [ref("sale_order_line_make_invoice_0")], {"lang":
+ 'en_US', "active_model": "sale.order.line", "active_ids": [ref(sol.id)], "tz":
+ False, "active_id": ref(sol.id), })
+-
+ I verify that invoice regarding sale order line has been created.
+-
+ !python {model: sale.order}: |
+ so = self.browse(cr, uid, ref("sale_order_so3"))
+ assert so.invoice_ids, "Invoices has not been generated for sale_order_so0"
diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py
index 2861a046205..34e996973d2 100644
--- a/addons/sale/wizard/sale_make_invoice_advance.py
+++ b/addons/sale/wizard/sale_make_invoice_advance.py
@@ -35,23 +35,23 @@ class sale_advance_payment_inv(osv.osv_memory):
'qtty' : lambda *a: 1
}
def create_invoices(self, cr, uid, ids, context={}):
- """
+ """
To create invoices.
-
+
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
- """
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return:
+
+ """
list_inv = []
obj_sale = self.pool.get('sale.order')
obj_lines = self.pool.get('account.invoice.line')
inv_obj = self.pool.get('account.invoice')
-
+
for sale_adv_obj in self.browse(cr, uid, ids):
for sale in obj_sale.browse(cr, uid, context['active_ids']):
address_contact = False
@@ -93,7 +93,7 @@ class sale_advance_payment_inv(osv.osv_memory):
'payment_term':sale.payment_term.id,
'fiscal_position': sale.fiscal_position.id or sale.partner_id.property_account_position.id
}
-
+
inv_id = inv_obj.create(cr, uid, inv)
for inv in sale.invoice_ids:
@@ -119,6 +119,8 @@ class sale_advance_payment_inv(osv.osv_memory):
'tax_id': [(6, 0, val['value']['invoice_line_tax_id'])],
}, context)
+ context.update({'invoice_id':list_inv})
+
return {#'invoice_ids':list_inv,
'name': 'Open Invoice',
'view_type': 'form',
@@ -126,7 +128,7 @@ class sale_advance_payment_inv(osv.osv_memory):
'res_model': 'sale.open.invoice',
'type': 'ir.actions.act_window',
'target': 'new',
- 'context': "{'invoice_ids'=%s}" % (list_inv)
+ 'context':context
}
sale_advance_payment_inv()
@@ -138,39 +140,49 @@ class sale_open_invoice(osv.osv_memory):
}
def open_invoice(self, cr, uid, ids, context):
- """
+
+ """
To open invoice.
-
+
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
- """
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return:
+
+ """
+ record_id = context and context.get('active_id', False) or False
+
mod_obj = self.pool.get('ir.model.data')
+ obj_inv = self.pool.get('account.invoice')
invoices = []
- #TODO: Can not get invoice ids here
+ invoice = obj_inv.browse(cr, uid, record_id, context=context)
+
for advance_pay in self.browse(cr, uid, ids):
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
id = mod_obj.read(cr, uid, result, ['res_id'])
- model_data_ids = mod_obj.search(cr, uid,
- [('model', '=', 'ir.ui.view'), ('name', '=', 'invoice_form')])
- resource_id = mod_obj.read(cr, uid, model_data_ids,
- fields=['res_id'])[0]['res_id']
+ form_id = mod_obj._get_id(cr, uid, 'account', 'invoice_form')
+ form_res = mod_obj.browse(cr, uid, form_id, context=context).res_id
+ tree_id = mod_obj._get_id(cr, uid, 'account', 'invoice_tree')
+ tree_res = mod_obj.browse(cr, uid, tree_id, context=context).res_id
return {
# 'domain': "[('id','in', ["+','.join(map(str, invoices))+"])]", # TODO
'name': 'Invoices',
'view_type': 'form',
- 'view_mode': 'tree,form',
+ 'view_mode': 'form,tree',
'res_model': 'account.invoice',
- 'views': [(False, 'tree'), (resource_id, 'form')],
+ 'res_id': int(context['invoice_id'][0]),
+ 'view_id': False,
+ 'views': [(form_res, 'form'), (tree_res, 'tree')],
'context': "{'type':'out_invoice'}",
'type': 'ir.actions.act_window',
- 'search_view_id': id['res_id']
}
+
+
+
+
sale_open_invoice()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_crm/i18n/hr.po b/addons/sale_crm/i18n/hr.po
index e20aa353017..b1614749563 100644
--- a/addons/sale_crm/i18n/hr.po
+++ b/addons/sale_crm/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/sale_journal/i18n/hr.po b/addons/sale_journal/i18n/hr.po
index 2e1aacbfce7..3fa941778b0 100644
--- a/addons/sale_journal/i18n/hr.po
+++ b/addons/sale_journal/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/sale_mrp/__init__.py b/addons/sale_mrp/__init__.py
new file mode 100644
index 00000000000..c47eb12b3f3
--- /dev/null
+++ b/addons/sale_mrp/__init__.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import sale_mrp
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_mrp/__openerp__.py b/addons/sale_mrp/__openerp__.py
new file mode 100644
index 00000000000..9ac55911983
--- /dev/null
+++ b/addons/sale_mrp/__openerp__.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+
+{
+ 'name': 'Sales and MRP Management',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Sales & MRP',
+ 'description': """
+ This module provides facility to the user to install mrp and sale modules
+ at a time. It is basically used when we want to keep track of production
+ orders generated from sale orders.
+ """,
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['mrp', 'sale'],
+ 'init_xml': [],
+ 'update_xml': [
+ 'sale_mrp_view.xml',
+ ],
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '',
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale/mrp.py b/addons/sale_mrp/sale_mrp.py
similarity index 81%
rename from addons/sale/mrp.py
rename to addons/sale_mrp/sale_mrp.py
index bb16a65425a..4f52cb7dd9b 100644
--- a/addons/sale/mrp.py
+++ b/addons/sale_mrp/sale_mrp.py
@@ -23,10 +23,14 @@
from osv import osv, fields
class mrp_production(osv.osv):
-
_inherit = 'mrp.production'
def _ref_calc(self, cr, uid, ids, field_names=None, arg=False, context={}):
+ """ Finds reference of sale order for production order.
+ @param field_names: Names of fields.
+ @param arg: User defined arguments
+ @return: Dictionary of values.
+ """
if not field_names:
field_names=[]
res = {}
@@ -65,4 +69,11 @@ class mrp_production(osv.osv):
res[production['id']] = move.sale_line_id and move.sale_line_id.order_id.client_order_ref or False
return res
-mrp_production()
\ No newline at end of file
+ _columns = {
+ 'sale_name': fields.function(_ref_calc, method=True, multi='sale_name', type='char', string='Sale Name', help='Indicate the name of sale order.'),
+ 'sale_ref': fields.function(_ref_calc, method=True, multi='sale_ref', type='char', string='Sale Reference', help='Indicate the Customer Reference from sale order.'),
+ }
+
+mrp_production()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_mrp/sale_mrp_view.xml b/addons/sale_mrp/sale_mrp_view.xml
new file mode 100644
index 00000000000..a595e9471be
--- /dev/null
+++ b/addons/sale_mrp/sale_mrp_view.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ mrp.production.form
+ mrp.production
+
+ form
+
+
+
+
+
+
+
+
+
diff --git a/addons/scrum/i18n/ko.po b/addons/scrum/i18n/ko.po
index 53022cb34d4..7715e88937c 100644
--- a/addons/scrum/i18n/ko.po
+++ b/addons/scrum/i18n/ko.po
@@ -14,7 +14,11 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+<<<<<<< TREE
+"X-Launchpad-Export-Date: 2010-04-07 03:46+0000\n"
+=======
"X-Launchpad-Export-Date: 2010-04-17 03:59+0000\n"
+>>>>>>> MERGE-SOURCE
"X-Generator: Launchpad (build Unknown)\n"
#. module: scrum
diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py
index c5e2aef2ff6..722fa9809b0 100644
--- a/addons/share/wizard/share_wizard.py
+++ b/addons/share/wizard/share_wizard.py
@@ -76,7 +76,7 @@ class share_create(osv.osv_memory):
'user_type': fields.selection( [ ('existing','Existing'),('new','New')],'User Type'),
'user_ids': fields.many2many('res.users', 'share_user_rel', 'share_id','user_id', 'Share Users'),
'new_user': fields.text("New user"),
- 'access_mode': fields.selection( [ ('readonly','READ ONLY'),('readwrite','READ & WRITE')],'Access Mode'),
+ 'access_mode': fields.selection([('readwrite','READ & WRITE'),('readonly','READ ONLY')],'Access Mode'),
'write_access': fields.function(_access, method=True, string='Write Access',type='boolean', multi='write_access'),
'read_access': fields.function(_access, method=True, string='Write Access',type='boolean', multi='read_access'),
}
@@ -84,6 +84,7 @@ class share_create(osv.osv_memory):
'user_type' : 'existing',
'domain': '[]',
'access_mode': 'readonly'
+
}
def default_get(self, cr, uid, fields, context=None):
@@ -124,7 +125,8 @@ class share_create(osv.osv_memory):
vals ={
'domain': this.domain,
'action_id': this.action_id and this.action_id.id or False,
- }
+ }
+ step1_id = this.id
context.update(vals)
value = {
@@ -132,7 +134,8 @@ class share_create(osv.osv_memory):
'view_type': 'form',
'view_mode': 'form',
'res_model': 'share.create',
- 'view_id': False,
+ 'view_id': False,
+ 'res_id': step1_id,
'views': [(step1_form_view_id, 'form'), (False, 'tree'), (False, 'calendar'), (False, 'graph')],
'type': 'ir.actions.act_window',
'context': context,
@@ -162,9 +165,6 @@ class share_create(osv.osv_memory):
'user_type': this.user_type,
'existing_user_ids': map(lambda x:x.id, this.user_ids),
'new_user': this.new_user,
- 'domain': this.domain,
- 'access_mode': this.access_mode,
- 'action_id': this.action_id and this.action_id.id or False
}
context.update(vals)
@@ -189,6 +189,13 @@ class share_create(osv.osv_memory):
"""
if not context:
context = {}
+
+ for this in self.browse(cr, uid, ids, context=context):
+ vals ={
+ 'access_mode': this.access_mode,
+ }
+
+ context.update(vals)
group_obj = self.pool.get('res.groups')
user_obj = self.pool.get('res.users')
@@ -248,7 +255,7 @@ class share_create(osv.osv_memory):
#ACCESS RIGHTS / IR.RULES COMPUTATION
- #TODO: TO Resolve Recurrent Problems
+
active_model_ids = model_obj.search(cr, uid, [('model','=',active_model)])
active_model_id = active_model_ids and active_model_ids[0] or False
@@ -268,14 +275,36 @@ class share_create(osv.osv_memory):
return obj
- obj0 = model_obj.browse(cr, uid, active_model_id, context=context)
+ active_model = model_obj.browse(cr, uid, active_model_id, context=context)
+ obj0 = [(None, active_model)]
obj1 = _get_relation(active_model_id, ['one2many'])
obj2 = _get_relation(active_model_id, ['one2many', 'many2many'])
obj3 = _get_relation(active_model_id, ['many2one'])
for rel_field, model in obj1:
obj3 += _get_relation(model.id, ['many2one'])
+
+ current_user = user_obj.browse(cr, uid, uid, context=context)
if access_mode == 'readonly':
- for rel_field, model in obj1+obj2+obj3:
+ res = []
+ # intersect with read access rights of user running the
+ # wizard, to avoid adding more access than current
+ for group in current_user.groups_id:
+ for access_control in group.model_access:
+ if access_control.model_id.id in res:
+ continue
+ if access_control.perm_read:
+ res.append(access_control.model_id.id)
+ model_access_obj.create(cr, uid, {
+ 'name': 'Read Access of group %s on %s model'%(share_group_name, access_control.model_id.name),
+ 'model_id' : access_control.model_id.id,
+ 'group_id' : group_id,
+ 'perm_read' : True
+ })
+ res = []
+ for rel_field, model in obj0+obj1+obj2+obj3:
+ if model.id in res:
+ continue
+ res.append(model.id)
model_access_obj.create(cr, uid, {
'name': 'Read Access of group %s on %s model'%(share_group_name, model.name),
'model_id' : model.id,
@@ -283,27 +312,68 @@ class share_create(osv.osv_memory):
'perm_read' : True
})
if access_mode == 'readwrite':
- for rel_field, model in obj1+obj2+obj3:
+ res = []
+ for rel_field, model in obj0+obj1:
+ if model.id in res:
+ continue
+ res.append(model.id)
model_access_obj.create(cr, uid, {
- 'name': 'Read Access of group %s on %s model'%(share_group_name, model.name),
+ 'name': 'Write Access of group %s on %s model'%(share_group_name, model.name),
'model_id' : model.id,
'group_id' : group_id,
'perm_read' : True,
- 'perm_write' : True
+ 'perm_write' : True,
+ 'perm_unlink' : True,
+ 'perm_create' : True,
+ })
+ # intersect with access rights of user
+ # running the wizard, to avoid adding more access than current
+
+ for group in current_user.groups_id:
+ for access_control in group.model_access:
+ if access_control.model_id.id in res:
+ continue
+ if access_control.perm_read:
+ res.append(access_control.model_id.id)
+ model_access_obj.create(cr, uid, {
+ 'name': 'Read Access of group %s on %s model'%(share_group_name, access_control.model_id.name),
+ 'model_id' : access_control.model_id.id,
+ 'group_id' : group_id,
+ 'perm_read' : True
})
for rel_field, model in obj2+obj3:
+ if model.id in res:
+ continue
+ res.append(model.id)
model_access_obj.create(cr, uid, {
'name': 'Read Access of group %s on %s model'%(share_group_name, model.name),
'model_id' : model.id,
'group_id' : group_id,
'perm_read' : True
})
+ #
+ # And on OBJ0, OBJ1, OBJ2, OBJ3: add all rules from groups of the user
+ # that is sharing in the many2many of the rules on the new group
+ # (rule must be copied instead of adding it if it contains a reference to uid
+ # or user.xxx so it can be replaced correctly)
+
+ for group in current_user.groups_id:
+ res = []
+ for rel_field, model in obj0+obj1+obj2+obj3:
+ if model.id in res:
+ continue
+ res.append(model.id)
+ for rule in group.rule_groups:
+ if rule.model_id == model.id:
+ rule_obj.copy(cr, uid, rule.id, default={
+ 'name': '%s-%s'%(share_group_name, model.model),
+ 'groups': [(6,0,[group_id])]}, context=context)
rule_obj.create(cr, uid, {
- 'name': '%s-%s'%(share_group_name, obj0.model),
- 'model_id': obj0.id,
- 'domain': domain,
- 'group_ids': [(6,0,[group_id])]
+ 'name': '%s-%s'%(share_group_name, active_model.model),
+ 'model_id': active_model.id,
+ 'domain_force': domain,
+ 'groups': [(6,0,[group_id])]
})
for rel_field, model in obj1:
obj1_domain = []
@@ -314,15 +384,10 @@ class share_create(osv.osv_memory):
rule_obj.create(cr, uid, {
'name': '%s-%s'%(share_group_name, model.model),
'model_id': model.id,
- 'domain': obj1_domain,
+ 'domain_force': obj1_domain,
'groups': [(6,0,[group_id])]
})
- # TODO:
- # And on OBJ0, OBJ1, OBJ2, OBJ3: add all rules from groups of the user
- # that is sharing in the many2many of the rules on the new group
- # (rule must be copied instead of adding it if it contains a reference to uid
- # or user.xxx so it can be replaced correctly)
- context['share_model'] = active_model
+ context['share_model'] = active_model.model
context['share_rec_id'] = active_id
diff --git a/addons/share/wizard/share_wizard_view.xml b/addons/share/wizard/share_wizard_view.xml
index 9e9b23f7f43..159583eecbb 100644
--- a/addons/share/wizard/share_wizard_view.xml
+++ b/addons/share/wizard/share_wizard_view.xml
@@ -39,8 +39,7 @@
-
-
+
@@ -54,13 +53,12 @@
-
-
+
+
-
diff --git a/addons/stock/product.py b/addons/stock/product.py
index dc300994232..16db5f4e1f2 100644
--- a/addons/stock/product.py
+++ b/addons/stock/product.py
@@ -25,15 +25,38 @@ from tools.translate import _
class product_product(osv.osv):
_inherit = "product.product"
+
+
+ def get_product_accounts(self, cr, uid, product_id, context=None):
+ """ To get the stock input account, stock output account and stock journal related to product.
+ @param product_id: product id
+ @return: dictionary which contains information regarding stock input account, stock output account and stock journal
+ """
+ product_obj = self.pool.get('product.product').browse(cr, uid, product_id, context)
+
+ stock_input_acc = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id or False
+ if not stock_input_acc:
+ stock_input_acc = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id or False
+
+ stock_output_acc = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id or False
+ if not stock_output_acc:
+ stock_output_acc = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id or False
+
+ journal_id = product_obj.categ_id.property_stock_journal and product_obj.categ_id.property_stock_journal.id or False
+ account_variation = product_obj.categ_id.property_stock_variation and product_obj.categ_id.property_stock_variation.id or False
+
+ return {
+ 'stock_account_input': stock_input_acc,
+ 'stock_account_output': stock_output_acc,
+ 'stock_journal': journal_id,
+ 'property_stock_variation': account_variation
+ }
def do_change_standard_price(self, cr, uid, ids, datas, context={}):
- """
- Changes the Standard Price of Product and creates an account move accordingly.
-
- @param datas : dict. contain default datas like new_price, stock_output_account, stock_input_account, stock_journal
- @param context: A standard dictionary
-
- @return:
+ """ Changes the Standard Price of Product and creates an account move accordingly.
+ @param datas : dict. contain default datas like new_price, stock_output_account, stock_input_account, stock_journal
+ @param context: A standard dictionary
+ @return:
"""
location_obj = self.pool.get('stock.location')
@@ -44,10 +67,12 @@ class product_product(osv.osv):
stock_output_acc = datas.get('stock_output_account', False)
stock_input_acc = datas.get('stock_input_account', False)
journal_id = datas.get('stock_journal', False)
-
+ property_obj=self.pool.get('ir.property')
+ product_obj=self.browse(cr,uid,ids)[0]
+ account_variation = product_obj.categ_id.property_stock_variation
move_ids = []
for rec_id in ids:
- loc_ids = location_obj.search(cr, uid, [('account_id','<>',False),('usage','=','internal')])
+ loc_ids = location_obj.search(cr, uid,[('usage','=','internal')])
for location in location_obj.browse(cr, uid, loc_ids):
c = context.copy()
c.update({
@@ -60,7 +85,8 @@ class product_product(osv.osv):
diff = product.standard_price - new_price
assert diff, _("Could not find any difference between standard price and new price!")
if qty:
- location_account = location.account_id and location.account_id.id or False
+ location_account = account_variation and account_variation.id or False
+
company_id = location.company_id and location.company_id.id or False
assert location_account, _('Inventory Account is not specified for Location: %s' % (location.name))
assert company_id, _('Company is not specified in Location')
@@ -147,7 +173,10 @@ class product_product(osv.osv):
return _('Products: ')+self.pool.get('stock.location').browse(cr, user, context['location'], context).name
return res
- def get_product_available(self,cr,uid,ids,context=None):
+ def get_product_available(self, cr, uid, ids, context=None):
+ """ Finds whether product is available or not in particular warehouse.
+ @return: Dictionary of values
+ """
if context is None:
context = {}
states = context.get('states',[])
@@ -252,22 +281,25 @@ class product_product(osv.osv):
return res
def _product_available(self, cr, uid, ids, field_names=None, arg=False, context={}):
+ """ Finds the incoming and outgoing quantity of product.
+ @return: Dictionary of values
+ """
if not field_names:
- field_names=[]
+ field_names = []
res = {}
for id in ids:
res[id] = {}.fromkeys(field_names, 0.0)
for f in field_names:
c = context.copy()
- if f=='qty_available':
- c.update({ 'states':('done',), 'what':('in', 'out') })
- if f=='virtual_available':
- c.update({ 'states':('confirmed','waiting','assigned','done'), 'what':('in', 'out') })
- if f=='incoming_qty':
- c.update({ 'states':('confirmed','waiting','assigned'), 'what':('in',) })
- if f=='outgoing_qty':
- c.update({ 'states':('confirmed','waiting','assigned'), 'what':('out',) })
- stock=self.get_product_available(cr,uid,ids,context=c)
+ if f == 'qty_available':
+ c.update({ 'states': ('done',), 'what': ('in', 'out') })
+ if f == 'virtual_available':
+ c.update({ 'states': ('confirmed','waiting','assigned','done'), 'what': ('in', 'out') })
+ if f == 'incoming_qty':
+ c.update({ 'states': ('confirmed','waiting','assigned'), 'what': ('in',) })
+ if f == 'outgoing_qty':
+ c.update({ 'states': ('confirmed','waiting','assigned'), 'what': ('out',) })
+ stock = self.get_product_available(cr, uid, ids, context=c)
for id in ids:
res[id][f] = stock.get(id, 0.0)
return res
@@ -281,7 +313,14 @@ class product_product(osv.osv):
'track_incoming': fields.boolean('Track Incoming Lots', help="Forces to use a tracking lot during receptions"),
'track_outgoing': fields.boolean('Track Outgoing Lots', help="Forces to use a tracking lot during deliveries"),
'location_id': fields.dummy(string='Location', relation='stock.location', type='many2one', domain=[('usage','=','internal')]),
+ 'valuation':fields.selection([('manual_periodic', 'Periodic (manual)'),
+ ('real_time','Real Time (automatized)'),], 'Stock Valuation', help="Decide if the system must automatically creates account moves based on stock moves", required=True),
}
+
+ _defaults = {
+ 'valuation': lambda *a: 'manual_periodic',
+ }
+
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
res = super(product_product,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
if context == None:
@@ -367,7 +406,6 @@ class product_template(osv.osv):
string='Stock Output Account', method=True, view_load=True,
help='This account will be used, instead of the default one, to value output stock'),
}
-
product_template()
@@ -386,8 +424,13 @@ class product_category(osv.osv):
type='many2one', relation='account.account',
string='Stock Output Account', method=True, view_load=True,
help='This account will be used to value the output stock'),
+ 'property_stock_variation': fields.property('account.account',
+ type='many2one',
+ relation='account.account',
+ string="Stock variation Account",
+ method=True, view_load=True,
+ help="This account will be used in product when valuation type is real-time valuation ",),
}
-
product_category()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml
index 02c60968e04..4f6ede6c460 100644
--- a/addons/stock/product_view.xml
+++ b/addons/stock/product_view.xml
@@ -123,6 +123,18 @@
+
+ product.valuation.stock.form.inherit
+ product.product
+ form
+
+
+
+
+
+
+
+
diff --git a/addons/stock/report/report_stock_move_view.xml b/addons/stock/report/report_stock_move_view.xml
index a3771b4a480..458fc250091 100755
--- a/addons/stock/report/report_stock_move_view.xml
+++ b/addons/stock/report/report_stock_move_view.xml
@@ -10,6 +10,7 @@
+
@@ -18,9 +19,7 @@
-
-
@@ -60,15 +59,10 @@
help="Stock Moves of today"/>
-
-
-
+ domain="[('state','in',('assigned','done','waiting','confirmed'))]"
+ help = "Future Stock-Moves"/>
+
-
-
+
+
-
+
@@ -112,7 +107,7 @@
formtree,graph
- {'search_default_product':1, 'search_default_src_location':1,'search_default_done':1,'group_by':[]}
+ {'search_default_product':1, 'search_default_src_location':1,'search_default_done':1,'group_by':[], 'group_by_no_leaf':1}
- Incoming Products
+ Incoming Packingsstock.moveir.actions.act_windowform
@@ -1761,5 +1764,33 @@
calendar
+
+
+ Outcoming Packings
+ stock.move
+ ir.actions.act_window
+ form
+ tree,form
+ [('picking_id','!=',False),('picking_id.type','=','out')]
+
+ {"search_default_receive":1}
+
+
+
+
+
+ tree
+
+
+
+
+
+ form
+
+
+
+
+
+
diff --git a/addons/stock/test/stock_test.yml b/addons/stock/test/stock_test.yml
index 6a9bf3ff9f3..38ecddffb91 100644
--- a/addons/stock/test/stock_test.yml
+++ b/addons/stock/test/stock_test.yml
@@ -288,6 +288,7 @@
In Order to test the picking I create picking with move lines.
-
!record {model: stock.picking, id: stock_picking_0}:
+ name: test_picking
address_id: res_partner_address_0
company_id: base.main_company
date: '2010-05-11 15:18:52'
diff --git a/addons/stock/wizard/stock_change_standard_price.py b/addons/stock/wizard/stock_change_standard_price.py
index d83b2c1d140..149b0b04e84 100644
--- a/addons/stock/wizard/stock_change_standard_price.py
+++ b/addons/stock/wizard/stock_change_standard_price.py
@@ -34,17 +34,13 @@ class change_standard_price(osv.osv_memory):
}
def default_get(self, cr, uid, fields, context):
- """
- To get default values for the object.
-
+ """ To get default values for the object.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param fields: List of fields for which we want default values
@param context: A standard dictionary
-
@return: A dictionary which of fields with values.
-
"""
product_pool = self.pool.get('product.product')
product_obj = product_pool.browse(cr, uid, context.get('active_id', False))
@@ -68,6 +64,16 @@ class change_standard_price(osv.osv_memory):
return res
def onchange_price(self, cr, uid, ids, new_price, context = {}):
+ """ Sets stock input and output account according to the difference
+ of old price and new price.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param new_price: Changed price
+ @param context: A standard dictionary
+ @return: Dictionary of values
+ """
product_obj = self.pool.get('product.product').browse(cr, uid, context.get('active_id', False))
price = product_obj.standard_price
diff = price - new_price
@@ -77,18 +83,14 @@ class change_standard_price(osv.osv_memory):
return {'value' : {'enable_stock_in_out_acc':False}}
def change_price(self, cr, uid, ids, context):
- """
- Changes the Standard Price of Product.
- And creates an account move accordingly.
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: List of IDs selected
- @param context: A standard dictionary
-
- @return:
-
+ """ Changes the Standard Price of Product.
+ And creates an account move accordingly.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+ @return:
"""
rec_id = context and context.get('active_id', False)
assert rec_id, _('Active ID is not set in Context')
diff --git a/addons/stock/wizard/stock_fill_inventory.py b/addons/stock/wizard/stock_fill_inventory.py
index 3247628657a..3742349425c 100644
--- a/addons/stock/wizard/stock_fill_inventory.py
+++ b/addons/stock/wizard/stock_fill_inventory.py
@@ -34,21 +34,17 @@ class stock_fill_inventory(osv.osv_memory):
_description = "Fill Inventory"
_columns = {
'location_id': fields.many2one('stock.location', 'Location', required=True),
- 'recursive': fields.boolean("Include all childs for the location"),
- }
+ 'recursive': fields.boolean("Include all children for the location"),
+ }
def fill_inventory(self, cr, uid, ids, context):
- """
- To fill stock inventory according to products available in the selected locations..
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
+ """ To fill stock inventory according to products available in the selected locations.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
"""
inventory_line_obj = self.pool.get('stock.inventory.line')
location_obj = self.pool.get('stock.location')
diff --git a/addons/stock/wizard/stock_inventory_line_split.py b/addons/stock/wizard/stock_inventory_line_split.py
index 9fe71582c7f..9f91a47c9a5 100644
--- a/addons/stock/wizard/stock_inventory_line_split.py
+++ b/addons/stock/wizard/stock_inventory_line_split.py
@@ -35,17 +35,13 @@ class stock_inventory_line_split(osv.osv_memory):
def default_get(self, cr, uid, fields, context):
- """
- To check the availability of production lot.
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for which we want default values
- @param context: A standard dictionary
-
- @return: A dictionary which of fields with values.
-
+ """ To check the availability of production lot.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+ @return: A dictionary which of fields with values.
"""
record_id = context and context.get('active_id',False)
res = super(stock_inventory_line_split, self).default_get(cr, uid, fields, context=context)
@@ -55,18 +51,14 @@ class stock_inventory_line_split(osv.osv_memory):
return res
def split(self, cr, uid, ids, line_ids, context=None):
- """
- To split stock inventory lines according to production lot
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param line_ids: the ID or list of IDs of inventory lines we want to split
- @param context: A standard dictionary
-
- @return:
-
+ """ To split stock inventory lines according to production lot.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param line_ids: the ID or list of IDs of inventory lines we want to split
+ @param context: A standard dictionary
+ @return:
"""
prodlot_obj = self.pool.get('stock.production.lot')
ir_sequence_obj = self.pool.get('ir.sequence')
diff --git a/addons/stock/wizard/stock_inventory_merge.py b/addons/stock/wizard/stock_inventory_merge.py
index 1c11ad8e2ad..30450e4d253 100644
--- a/addons/stock/wizard/stock_inventory_merge.py
+++ b/addons/stock/wizard/stock_inventory_merge.py
@@ -31,22 +31,15 @@ import wizard
class stock_inventory_merge(osv.osv_memory):
_name = "stock.inventory.merge"
_description = "Merge Inventory"
- _columns = {
-
- }
def do_merge(self, cr, uid, ids, context):
- """
- To merge selected Inventories.
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: List of IDs selected
- @param context: A standard dictionary
-
- @return:
-
+ """ To merge selected Inventories.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+ @return:
"""
invent_obj = self.pool.get('stock.inventory')
invent_line_obj = self.pool.get('stock.inventory.line')
diff --git a/addons/stock/wizard/stock_inventory_set_stock_zero.py b/addons/stock/wizard/stock_inventory_set_stock_zero.py
index 63296b69875..f72e4f088b0 100644
--- a/addons/stock/wizard/stock_inventory_set_stock_zero.py
+++ b/addons/stock/wizard/stock_inventory_set_stock_zero.py
@@ -32,22 +32,19 @@ import wizard
class inventory_set_stock_zero(osv.osv_memory):
_name = "stock.inventory.set.stock.zero"
_description = "Set Stock to 0"
+
_columns = {
'location_id': fields.many2one('stock.location', 'Location', required=True),
- }
+ }
def do_merge(self, cr, uid, ids, context):
- """
- To set stock to Zero
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
+ """ To set stock to Zero
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
"""
invent_obj = pooler.get_pool(cr.dbname).get('stock.inventory')
invent_line_obj = pooler.get_pool(cr.dbname).get('stock.inventory.line')
diff --git a/addons/stock/wizard/stock_invoice_onshipping.py b/addons/stock/wizard/stock_invoice_onshipping.py
index d2b671e9571..377a40f3cb9 100644
--- a/addons/stock/wizard/stock_invoice_onshipping.py
+++ b/addons/stock/wizard/stock_invoice_onshipping.py
@@ -39,20 +39,16 @@ class stock_invoice_onshipping(osv.osv_memory):
('out_refund', 'Customer Refund'),
('in_refund', 'Supplier Refund')] , 'Type', required=True),
'invoice_date': fields.date('Invoiced date'),
- }
+ }
def _get_type(self, cr, uid, context=None):
- """
- To get invoice type
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return: invoice type
-
+ """ To get invoice type.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: The ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return: Invoice type
"""
if context is None:
context = {}
@@ -80,20 +76,16 @@ class stock_invoice_onshipping(osv.osv_memory):
_defaults = {
'type': _get_type,
- }
+ }
def create_invoice(self, cr, uid, ids, context):
- """
- To create invoice
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return: invoice ids
-
+ """ To create invoice
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return: Invoice ids
"""
result = []
picking_obj = self.pool.get('stock.picking')
diff --git a/addons/stock/wizard/stock_location_product.py b/addons/stock/wizard/stock_location_product.py
index b41809b67bd..9fe800bb0fe 100644
--- a/addons/stock/wizard/stock_location_product.py
+++ b/addons/stock/wizard/stock_location_product.py
@@ -30,16 +30,13 @@ class stock_location_product(osv.osv_memory):
}
def action_open_window(self, cr, uid, ids, context):
- """
- To open location wise product information specific to given duration
-
+ """ To open location wise product information specific to given duration
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
+ @param ids: An ID or list of IDs if we want more than one
@param context: A standard dictionary
-
- @return: invoice type
+ @return: Invoice type
"""
mod_obj = self.pool.get('ir.model.data')
for location_obj in self.read(cr, uid, ids, ['from_date', 'to_date']):
diff --git a/addons/stock/wizard/stock_move.py b/addons/stock/wizard/stock_move.py
index aa7bb42cf8b..bce550e74ff 100644
--- a/addons/stock/wizard/stock_move.py
+++ b/addons/stock/wizard/stock_move.py
@@ -29,24 +29,20 @@ class stock_move_track(osv.osv_memory):
_columns = {
'tracking_prefix': fields.char('Tracking prefix', size=64),
'quantity': fields.float("Quantity per lot")
- }
+ }
_defaults = {
'quantity': lambda *x: 1
- }
+ }
def track_lines(self, cr, uid, ids, context={}):
- """
- To track stock moves lines
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
+ """ To track stock moves lines
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: An ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
"""
datas = self.read(cr, uid, ids)[0]
move_obj = self.pool.get('stock.move')
@@ -67,17 +63,13 @@ class stock_move_consume(osv.osv_memory):
}
def default_get(self, cr, uid, fields, context=None):
- """
- Get default values
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for default value
- @param context: A standard dictionary
-
- @return: default values of fields
-
+ """ Get default values
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for default value
+ @param context: A standard dictionary
+ @return: default values of fields
"""
res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
@@ -93,17 +85,13 @@ class stock_move_consume(osv.osv_memory):
return res
def do_move_consume(self, cr, uid, ids, context={}):
- """
- To move consumed products
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
+ """ To move consumed products
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
"""
move_obj = self.pool.get('stock.move')
move_ids = context['active_ids']
@@ -126,17 +114,13 @@ class stock_move_scrap(osv.osv_memory):
}
def default_get(self, cr, uid, fields, context=None):
- """
- Get default values
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for default value
- @param context: A standard dictionary
-
- @return: default values of fields
-
+ """ Get default values
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for default value
+ @param context: A standard dictionary
+ @return: default values of fields
"""
res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
@@ -158,17 +142,13 @@ class stock_move_scrap(osv.osv_memory):
return res
def move_scrap(self, cr, uid, ids, context={}):
- """
- To move scraped products
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
+ """ To move scraped products
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
"""
move_obj = self.pool.get('stock.move')
move_ids = context['active_ids']
@@ -186,58 +166,52 @@ class split_in_production_lot(osv.osv_memory):
_description = "Split in Production lots"
def default_get(self, cr, uid, fields, context=None):
- """
- Get default values
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for default value
- @param context: A standard dictionary
-
- @return: default values of fields
-
+ """ Get default values
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for default value
+ @param context: A standard dictionary
+ @return: Default values of fields
"""
res = super(split_in_production_lot, self).default_get(cr, uid, fields, context=context)
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
if 'product_id' in fields:
res.update({'product_id': move.product_id.id})
+ if 'qty' in fields:
+ res.update({'qty': move.product_qty})
return res
_columns = {
+ 'qty': fields.integer('Quantity'),
'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
- 'line_ids': fields.one2many('stock.move.split.lines', 'lot_id', 'Lots Number')
+ 'line_ids': fields.one2many('stock.move.split.lines', 'lot_id', 'Lots Number'),
+ 'line_exist_ids': fields.one2many('stock.move.split.lines.exist', 'lot_id', 'Lots Existing Numbers'),
+ 'use_exist' : fields.boolean('Use Exist'),
}
+
def split_lot(self, cr, uid, ids, context=None):
- """
- To split a lot
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
+ """ To split a lot
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: An ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
"""
self.split(cr, uid, ids, context.get('active_ids'), context=context)
return {}
def split(self, cr, uid, ids, move_ids, context=None):
- """
- To split stock moves into production lot
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param move_ids: the ID or list of IDs of stock move we want to split
- @param context: A standard dictionary
-
- @return:
-
+ """ To split stock moves into production lot
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param move_ids: the ID or list of IDs of stock move we want to split
+ @param context: A standard dictionary
+ @return:
"""
prodlot_obj = self.pool.get('stock.production.lot')
ir_sequence_obj = self.pool.get('ir.sequence')
@@ -249,10 +223,12 @@ class split_in_production_lot(osv.osv_memory):
quantity_rest = move.product_qty
uos_qty_rest = move.product_uos_qty
new_move = []
- for line in data.line_ids:
+ if data.use_exist:
+ lines = [l for l in data.line_exist_ids if l]
+ else:
+ lines = [l for l in data.line_ids if l]
+ for line in lines:
quantity = line.quantity
-
-
if quantity <= 0 or move_qty == 0:
continue
quantity_rest -= quantity
@@ -272,20 +248,21 @@ class split_in_production_lot(osv.osv_memory):
if quantity_rest == 0:
current_move = move.id
prodlot_id = False
- if line.use_exist and line.name:
- prodlot_id = prodlot_obj.search(cr, uid, [('prefix','=',line.name),('product_id','=',data.product_id.id)])
+ if data.use_exist and line.prodlot_id:
+ prodlot_id = prodlot_obj.search(cr, uid, [('id','=',line.prodlot_id.id)])
if prodlot_id:
- prodlot_id = prodlot_id[0]
+ prodlot_id = prodlot_id[0]
if not prodlot_id:
- sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial')
- prodlot_id = prodlot_obj.create(cr, uid, {'name': sequence, 'prefix' : line.name},
+ # sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial')
+ prodlot_id = prodlot_obj.create(cr, uid, {'name': line.name},
+ # 'prefix' : line.name},
{'product_id': move.product_id.id})
move_obj.write(cr, uid, [current_move], {'prodlot_id': prodlot_id})
prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
- ref = '%d' % (move.id)
- if prodlot.ref:
- ref = '%s, %s' % (prodlot.ref, ref)
- prodlot_obj.write(cr, uid, [prodlot_id], {'ref': ref})
+ # ref = '%d' % (move.id)
+ # if prodlot.ref:
+ # ref = '%s, %s' % (prodlot.ref, ref)
+ # prodlot_obj.write(cr, uid, [prodlot_id], {'ref': ref})
update_val = {}
if quantity_rest > 0:
@@ -295,10 +272,24 @@ class split_in_production_lot(osv.osv_memory):
return new_move
split_in_production_lot()
+class stock_move_split_lines_exist(osv.osv_memory):
+ _name = "stock.move.split.lines.exist"
+ _description = "Exist Split lines"
+ _columns = {
+ 'name': fields.char('Tracking serial', size=64),
+ 'quantity': fields.integer('Quantity'),
+ 'lot_id': fields.many2one('stock.move.split', 'Lot'),
+ 'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot'),
+ }
+ _defaults = {
+ 'quantity': lambda *x: 1,
+ }
+
+stock_move_split_lines_exist()
+
class stock_move_split_lines(osv.osv_memory):
_name = "stock.move.split.lines"
_description = "Split lines"
-
_columns = {
'name': fields.char('Tracking serial', size=64),
'quantity': fields.integer('Quantity'),
@@ -306,6 +297,7 @@ class stock_move_split_lines(osv.osv_memory):
'lot_id': fields.many2one('stock.move.split', 'Lot'),
'action': fields.selection([('split','Split'),('keepinone','Keep in one lot')],'Action'),
}
+
_defaults = {
'quantity': lambda *x: 1,
'action' : lambda *x: 'split',
diff --git a/addons/stock/wizard/stock_move_view.xml b/addons/stock/wizard/stock_move_view.xml
index 5f58072f17a..bba27bfe9c7 100644
--- a/addons/stock/wizard/stock_move_view.xml
+++ b/addons/stock/wizard/stock_move_view.xml
@@ -106,18 +106,32 @@