[IMP] Invoice_state on procurement order should be defined in stock_account
bzr revid: jco@openerp.com-20130830151201-6xwnaxymdynaja7h
This commit is contained in:
parent
0c943c01df
commit
b38138d555
|
@ -1072,12 +1072,6 @@ class procurement_order(osv.osv):
|
|||
_inherit = 'procurement.order'
|
||||
_columns = {
|
||||
'sale_line_id': fields.many2one('sale.order.line', string='Sale Order Line'),
|
||||
'invoice_state': fields.selection(
|
||||
[
|
||||
("invoiced", "Invoiced"),
|
||||
("2binvoiced", "To Be Invoiced"),
|
||||
("none", "Not Applicable")
|
||||
], "Invoice Control", required=True),
|
||||
}
|
||||
_defaults = {
|
||||
'invoice_state': 'none',
|
||||
|
|
|
@ -1623,10 +1623,11 @@ class stock_move(osv.osv):
|
|||
self.action_done(cr, uid, res, context=context)
|
||||
return res
|
||||
|
||||
|
||||
|
||||
def split(self, cr, uid, move, qty, context=None):
|
||||
"""
|
||||
Splits qty from move move into a new move
|
||||
It will check if it can propagate the split
|
||||
"""
|
||||
if move.product_qty==qty:
|
||||
return move.id
|
||||
|
|
|
@ -42,10 +42,17 @@ class procurement_rule(osv.osv):
|
|||
|
||||
class procurement_order(osv.osv):
|
||||
_inherit = "procurement.order"
|
||||
_columns = {
|
||||
'invoice_state': fields.selection(
|
||||
[("invoiced", "Invoiced"),
|
||||
("2binvoiced", "To Be Invoiced"),
|
||||
("none", "Not Applicable")
|
||||
], "Invoice Control", required=True),
|
||||
}
|
||||
|
||||
def _run_move_create(self, cr, uid, procurement, context=None):
|
||||
res = super(procurement_order, self)._run_move_create(cr, uid, procurement, context=context)
|
||||
res.update({'invoice_state': procurement.rule_id.invoice_state in ('none', False) and procurement.invoice_state or procurement.rule_id.invoice_state })
|
||||
res.update({'invoice_state': (procurement.rule_id.invoice_state in ('none', False) and procurement.invoice_state or procurement.rule_id.invoice_state) or 'none'})
|
||||
return res
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue