+
-
diff --git a/addons/sale/stock_view.xml b/addons/sale/stock_view.xml
index eb0f1e415f5..0eb64f98e9b 100644
--- a/addons/sale/stock_view.xml
+++ b/addons/sale/stock_view.xml
@@ -9,9 +9,6 @@
-
diff --git a/addons/sale/test/manual_order_policy.yml b/addons/sale/test/manual_order_policy.yml
index 3a8dcbd2f5b..17ebeb9f86b 100644
--- a/addons/sale/test/manual_order_policy.yml
+++ b/addons/sale/test/manual_order_policy.yml
@@ -1,5 +1,5 @@
-
- I confirm the Quotation with "Deliver & invoice on demand".
+ I confirm the Quotation with "On Demand" order policy.
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_2}
-
@@ -9,44 +9,34 @@
sale_order = self.browse(cr, uid, ref("sale_order_2"))
assert len(sale_order.invoice_ids) == False, "Invoice should not created."
-
- I create advance invoice.
+ I create advance invoice where type is 'Fixed Price'.
-
!python {model: sale.advance.payment.inv}: |
ctx = context.copy()
ctx.update({"active_model": 'sale.order', "active_ids": [ref("sale_order_2")], "active_id":ref("sale_order_2")})
order_line = self.pool.get('sale.order.line').browse(cr, uid, ref("sale_order_line_4"), context=context)
- pay_id = self.create(cr, uid, {'advance_payment_method': 'fixed', 'product_id': order_line.product_id.id, 'amount': order_line.price_subtotal, 'qtty': order_line.product_uom_qty})
+ pay_id = self.create(cr, uid, {'advance_payment_method': 'fixed', 'product_id': order_line.product_id.id, 'amount': order_line.price_unit})
self.create_invoices(cr, uid, [pay_id], context=ctx)
-
- I check Invoice which made advance
+ I check Invoice which made advance.
-
!python {model: sale.order}: |
order = self.browse(cr, uid, ref('sale_order_2'))
assert order.invoice_ids, "Invoice should be created after make advance invoice."
-
- I create Invoice from sale order line.
+ I create advance invoice where type is 'Invoice all the Sale Order'.
-
- !python {model: sale.order.line.make.invoice}: |
+ !python {model: sale.advance.payment.inv}: |
ctx = context.copy()
- ctx.update({"active_model": 'sale.order.line', "active_ids": [ref("sale_order_line_5")], "active_id":ref("sale_order_line_5")})
- self.make_invoices(cr, uid, [], context=ctx)
+ ctx.update({"active_model": 'sale.order', "active_ids": [ref("sale_order_2")], "active_id":ref("sale_order_2")})
+ pay_id = self.create(cr, uid, {'advance_payment_method': 'all'})
+ self.create_invoices(cr, uid, [pay_id], context=ctx)
-
- I check Invoice which made from sale order line.
+ I check Invoice which made advance where type is 'Invoice all the Sale Order'.
-
- !python {model: sale.order.line}: |
- line = self.browse(cr, uid, ref('sale_order_line_5'))
- assert line.invoiced, "Line is not invoiced."
- assert line.invoice_lines, "Invoice line should be created."
--
- I create manual Invoice for order.
--
- !record {model: sale.make.invoice, id: sale_make_invoice_1}:
- invoice_date: !eval time.strftime('%Y-%m-%d')
--
- !python {model: sale.make.invoice}: |
- ctx = context.copy()
- ctx = ctx.update({"active_model": 'sale.order', "active_ids": [ref("sale_order_2")], "active_id":ref("sale_order_2")})
- self.make_invoices(cr, uid, [ref("sale_make_invoice_1")], context)
+ !python {model: sale.order}: |
+ order = self.browse(cr, uid, ref('sale_order_2'))
+ assert order.invoice_ids, "Invoice should be created after make advance invoice where type is 'Invoice all the Sale Order'."
-
I open the Invoice.
-
@@ -57,7 +47,7 @@
for invoice in so.invoice_ids:
wf_service.trg_validate(uid, 'account.invoice', invoice.id, 'invoice_open', cr)
-
- I pay the invoice
+ I pay the invoice.
-
!python {model: account.invoice}: |
sale_order = self.pool.get('sale.order')
@@ -75,8 +65,9 @@
!python {model: sale.order}: |
sale_order = self.browse(cr, uid, ref("sale_order_2"))
assert sale_order.invoice_ids, "Invoice should be created."
- assert sale_order.invoiced, "Order is not invoiced."
- assert sale_order.state == 'manual', 'Order should be in Manual.'
+ assert sale_order.invoice_exists, "Order is not invoiced."
+ assert sale_order.invoiced, "Order is not paid."
+ assert sale_order.state == 'progress', 'Order should be in Progress.'
-
I set order policy "Deliver & invoice on demand" as default policy.
diff --git a/addons/stock/board_warehouse_view.xml b/addons/stock/board_warehouse_view.xml
index b223e731e8f..839a99c1fa7 100644
--- a/addons/stock/board_warehouse_view.xml
+++ b/addons/stock/board_warehouse_view.xml
@@ -61,7 +61,7 @@
parent="base.menu_reporting_dashboard"
action="open_board_warehouse"
sequence="25"
- groups="group_stock_manager"/>
+ groups="stock.group_stock_user"/>
diff --git a/addons/stock/report/report_stock_move_view.xml b/addons/stock/report/report_stock_move_view.xml
index a78a506cefe..4c911dd6e7c 100644
--- a/addons/stock/report/report_stock_move_view.xml
+++ b/addons/stock/report/report_stock_move_view.xml
@@ -6,7 +6,8 @@
id="stock.next_id_61"
name="Warehouse"
sequence="15"
- parent="base.menu_reporting"/>
+ parent="base.menu_reporting"
+ groups="group_stock_manager"/>
report.stock.move.tree
diff --git a/addons/stock/security/ir.model.access.csv b/addons/stock/security/ir.model.access.csv
index f56696bcbaa..b0ae333a9ef 100644
--- a/addons/stock/security/ir.model.access.csv
+++ b/addons/stock/security/ir.model.access.csv
@@ -21,11 +21,11 @@ access_stock_production_lot_manager,stock.production.lot manager,model_stock_pro
access_stock_production_lot_user,stock.production.lot user,model_stock_production_lot,stock.group_stock_user,1,1,1,1
access_stock_production_lot_revision,stock.production.lot.revision,model_stock_production_lot_revision,stock.group_stock_user,1,1,1,1
access_stock_move_manager,stock.move manager,model_stock_move,stock.group_stock_manager,1,1,0,0
-access_stock_move_user,stock.move user,model_stock_move,stock.group_stock_user,1,0,0,0
+access_stock_move_user,stock.move user,model_stock_move,stock.group_stock_user,1,1,1,0
access_stock_move_warehouse_manager,stock.move.manager,model_stock_move,stock.group_stock_manager,1,1,1,1
-access_stock_inventory_user,stock.inventory user,model_stock_inventory,stock.group_stock_user,1,0,0,0
+access_stock_inventory_user,stock.inventory user,model_stock_inventory,stock.group_stock_user,1,1,1,0
access_stock_inventory_manager,stock.inventory manager,model_stock_inventory,stock.group_stock_manager,1,1,1,1
-access_stock_inventory_line_user,stock.inventory.line user,model_stock_inventory_line,stock.group_stock_user,1,0,0,0
+access_stock_inventory_line_user,stock.inventory.line user,model_stock_inventory_line,stock.group_stock_user,1,1,1,0
access_stock_inventory_line_manager,stock.inventory.line manager,model_stock_inventory_line,stock.group_stock_manager,1,1,1,1
access_stock_report_prodlots,stock.report.prodlots,model_stock_report_prodlots,stock.group_stock_manager,1,0,0,0
access_stock_location_sale_manager,stock.location sale manager,model_stock_location,base.group_sale_manager,1,0,0,0
@@ -61,3 +61,4 @@ access_product_group_res_partner_stock_manager,res_partner group_stock_manager,b
access_product_pricelist_version_stock_manager,product.pricelist.version stock_manager,product.model_product_pricelist_version,stock.group_stock_manager,1,1,1,1
access_product_pricelist_item_stock_manager,product.pricelist.item stock_manager,product.model_product_pricelist_item,stock.group_stock_manager,1,1,1,1
access_account_account_stock_manager,account.account stock manager,account.model_account_account,stock.group_stock_manager,1,0,0,0
+access_board_stock_user,board.board user,board.model_board_board,stock.group_stock_user,1,1,0,0
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 31d5a68c9fe..041950df281 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -1659,6 +1659,7 @@ class stock_move(osv.osv):
# used for colors in tree views:
'scrapped': fields.related('location_dest_id','scrap_location',type='boolean',relation='stock.location',string='Scrapped', readonly=True),
+ 'type': fields.related('picking_id', 'type', type='selection', selection=[('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal')], string='Shipping Type'),
}
def _check_location(self, cr, uid, ids, context=None):
for record in self.browse(cr, uid, ids, context=context):
@@ -1738,10 +1739,25 @@ class stock_move(osv.osv):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
return user.company_id.partner_id.id
+ def _default_move_type(self, cr, uid, context=None):
+ """ Gets default type of move
+ @return: type
+ """
+ if context is None:
+ context = {}
+ picking_type = context.get('picking_type')
+ type = 'internal'
+ if picking_type == 'in':
+ type = 'in'
+ elif picking_type == 'out':
+ type = 'out'
+ return type
+
_defaults = {
'location_id': _default_location_source,
'location_dest_id': _default_location_destination,
'partner_id': _default_destination_address,
+ 'type': _default_move_type,
'state': 'draft',
'priority': '1',
'product_qty': 1.0,
@@ -1895,6 +1911,32 @@ class stock_move(osv.osv):
result['location_dest_id'] = loc_dest_id
return {'value': result}
+ def onchange_move_type(self, cr, uid, ids, type, context=None):
+ """ On change of move type gives sorce and destination location.
+ @param type: Move Type
+ @return: Dictionary of values
+ """
+ mod_obj = self.pool.get('ir.model.data')
+ location_source_id = False
+ location_dest_id = False
+ if type == 'in':
+ location_source_id = 'stock_location_suppliers'
+ location_dest_id = 'stock_location_stock'
+ elif type == 'out':
+ location_source_id = 'stock_location_stock'
+ location_dest_id = 'stock_location_customers'
+ if location_source_id:
+ try:
+ location_model, location_source_id = mod_obj.get_object_reference(cr, uid, 'stock', location_source_id)
+ except ValueError, e:
+ location_source_id = False
+ if location_dest_id:
+ try:
+ location_model, location_dest_id = mod_obj.get_object_reference(cr, uid, 'stock', location_dest_id)
+ except ValueError, e:
+ location_dest_id = False
+ return {'value':{'location_id': location_source_id, 'location_dest_id': location_dest_id}}
+
def onchange_date(self, cr, uid, ids, date, date_expected, context=None):
""" On change of Scheduled Date gives a Move date.
@param date_expected: Scheduled Date
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 154927a2f19..83fed186f42 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -106,13 +106,16 @@