parent
b5a174257b
commit
095558d2a6
|
@ -197,6 +197,7 @@
|
||||||
</page>
|
</page>
|
||||||
<page string="Other Info">
|
<page string="Other Info">
|
||||||
<field name="company_id"/>
|
<field name="company_id"/>
|
||||||
|
<field name="fiscal_position"/>
|
||||||
<newline/>
|
<newline/>
|
||||||
<field name="payment_term" on_change="onchange_payment_term_date_invoice(payment_term, date_invoice)"/>
|
<field name="payment_term" on_change="onchange_payment_term_date_invoice(payment_term, date_invoice)"/>
|
||||||
<field name="name" select="2"/>
|
<field name="name" select="2"/>
|
||||||
|
@ -283,6 +284,7 @@
|
||||||
</page>
|
</page>
|
||||||
<page string="Other Info">
|
<page string="Other Info">
|
||||||
<field name="company_id"/>
|
<field name="company_id"/>
|
||||||
|
<field name="fiscal_position"/>
|
||||||
<newline/>
|
<newline/>
|
||||||
<field name="date_due" select="1"/>
|
<field name="date_due" select="1"/>
|
||||||
<newline/>
|
<newline/>
|
||||||
|
|
|
@ -270,6 +270,7 @@ class account_invoice(osv.osv):
|
||||||
help="Remaining amount due."),
|
help="Remaining amount due."),
|
||||||
'payment_ids': fields.function(_compute_lines, method=True, relation='account.move.line', type="many2many", string='Payments'),
|
'payment_ids': fields.function(_compute_lines, method=True, relation='account.move.line', type="many2many", string='Payments'),
|
||||||
'move_name': fields.char('Account Move', size=64),
|
'move_name': fields.char('Account Move', size=64),
|
||||||
|
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position')
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'type': _get_type,
|
'type': _get_type,
|
||||||
|
@ -305,6 +306,7 @@ class account_invoice(osv.osv):
|
||||||
partner_payment_term = False
|
partner_payment_term = False
|
||||||
acc_id = False
|
acc_id = False
|
||||||
bank_id = False
|
bank_id = False
|
||||||
|
fiscal_position = False
|
||||||
|
|
||||||
opt = [('uid', str(uid))]
|
opt = [('uid', str(uid))]
|
||||||
if partner_id:
|
if partner_id:
|
||||||
|
@ -318,7 +320,8 @@ class account_invoice(osv.osv):
|
||||||
acc_id = p.property_account_receivable.id
|
acc_id = p.property_account_receivable.id
|
||||||
else:
|
else:
|
||||||
acc_id = p.property_account_payable.id
|
acc_id = p.property_account_payable.id
|
||||||
|
if p.property_account_position:
|
||||||
|
fiscal_position = p.property_account_position.id
|
||||||
partner_payment_term = p.property_payment_term and p.property_payment_term.id or False
|
partner_payment_term = p.property_payment_term and p.property_payment_term.id or False
|
||||||
if p.bank_ids:
|
if p.bank_ids:
|
||||||
bank_id = p.bank_ids[0].id
|
bank_id = p.bank_ids[0].id
|
||||||
|
@ -328,6 +331,7 @@ class account_invoice(osv.osv):
|
||||||
'address_invoice_id': invoice_addr_id,
|
'address_invoice_id': invoice_addr_id,
|
||||||
'account_id': acc_id,
|
'account_id': acc_id,
|
||||||
'payment_term': partner_payment_term,
|
'payment_term': partner_payment_term,
|
||||||
|
'fiscal_position': fiscal_position
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -184,6 +184,7 @@ class purchase_order(osv.osv):
|
||||||
store={
|
store={
|
||||||
'purchase.order.line': (_get_order, None, 10),
|
'purchase.order.line': (_get_order, None, 10),
|
||||||
}, multi="sums"),
|
}, multi="sums"),
|
||||||
|
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position')
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'date_order': lambda *a: time.strftime('%Y-%m-%d'),
|
'date_order': lambda *a: time.strftime('%Y-%m-%d'),
|
||||||
|
@ -227,11 +228,12 @@ class purchase_order(osv.osv):
|
||||||
|
|
||||||
def onchange_partner_id(self, cr, uid, ids, part):
|
def onchange_partner_id(self, cr, uid, ids, part):
|
||||||
if not part:
|
if not part:
|
||||||
return {'value':{'partner_address_id': False}}
|
return {'value':{'partner_address_id': False, 'fiscal_position': False}}
|
||||||
addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['default'])
|
addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['default'])
|
||||||
part = self.pool.get('res.partner').browse(cr, uid, part)
|
part = self.pool.get('res.partner').browse(cr, uid, part)
|
||||||
pricelist = part.property_product_pricelist_purchase.id
|
pricelist = part.property_product_pricelist_purchase.id
|
||||||
return {'value':{'partner_address_id': addr['default'], 'pricelist_id': pricelist}}
|
fiscal_position = part.property_account_position and part.property_account_position.id or False
|
||||||
|
return {'value':{'partner_address_id': addr['default'], 'pricelist_id': pricelist, 'fiscal_position': fiscal_position}}
|
||||||
|
|
||||||
def wkf_approve_order(self, cr, uid, ids, context={}):
|
def wkf_approve_order(self, cr, uid, ids, context={}):
|
||||||
self.write(cr, uid, ids, {'state': 'approved', 'date_approve': time.strftime('%Y-%m-%d')})
|
self.write(cr, uid, ids, {'state': 'approved', 'date_approve': time.strftime('%Y-%m-%d')})
|
||||||
|
|
|
@ -82,6 +82,7 @@
|
||||||
<separator string="Invoice Control" colspan="2"/>
|
<separator string="Invoice Control" colspan="2"/>
|
||||||
<field name="invoice_method"/>
|
<field name="invoice_method"/>
|
||||||
<field name="invoice_id" readonly="1"/>
|
<field name="invoice_id" readonly="1"/>
|
||||||
|
<field name="fiscal_position"/>
|
||||||
</group>
|
</group>
|
||||||
<newline/>
|
<newline/>
|
||||||
<separator string="Purchase Control" colspan="4"/>
|
<separator string="Purchase Control" colspan="4"/>
|
||||||
|
|
|
@ -250,6 +250,7 @@ class sale_order(osv.osv):
|
||||||
|
|
||||||
'invoice_quantity': fields.selection([('order','Ordered Quantities'),('procurement','Shipped Quantities')], 'Invoice on', help="The sale order will automatically create the invoice proposition (draft invoice). Ordered and delivered quantities may not be the same. You have to choose if you invoice based on ordered or shipped quantities. If the product is a service, shipped quantities means hours spent on the associated tasks.",required=True),
|
'invoice_quantity': fields.selection([('order','Ordered Quantities'),('procurement','Shipped Quantities')], 'Invoice on', help="The sale order will automatically create the invoice proposition (draft invoice). Ordered and delivered quantities may not be the same. You have to choose if you invoice based on ordered or shipped quantities. If the product is a service, shipped quantities means hours spent on the associated tasks.",required=True),
|
||||||
'payment_term' : fields.many2one('account.payment.term', 'Payment Term'),
|
'payment_term' : fields.many2one('account.payment.term', 'Payment Term'),
|
||||||
|
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position')
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'picking_policy': lambda *a: 'direct',
|
'picking_policy': lambda *a: 'direct',
|
||||||
|
@ -303,12 +304,13 @@ class sale_order(osv.osv):
|
||||||
|
|
||||||
def onchange_partner_id(self, cr, uid, ids, part):
|
def onchange_partner_id(self, cr, uid, ids, part):
|
||||||
if not part:
|
if not part:
|
||||||
return {'value':{'partner_invoice_id': False, 'partner_shipping_id':False, 'partner_order_id':False, 'payment_term' : False}}
|
return {'value':{'partner_invoice_id': False, 'partner_shipping_id':False, 'partner_order_id':False, 'payment_term' : False, 'fiscal_position': False}}
|
||||||
addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['delivery','invoice','contact'])
|
addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['delivery','invoice','contact'])
|
||||||
part = self.pool.get('res.partner').browse(cr, uid, part)
|
part = self.pool.get('res.partner').browse(cr, uid, part)
|
||||||
pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False
|
pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False
|
||||||
payment_term = part.property_payment_term and part.property_payment_term.id or False
|
payment_term = part.property_payment_term and part.property_payment_term.id or False
|
||||||
return {'value':{'partner_invoice_id': addr['invoice'], 'partner_order_id':addr['contact'], 'partner_shipping_id':addr['delivery'], 'pricelist_id': pricelist, 'payment_term' : payment_term}}
|
fiscal_position = part.property_account_position and part.property_account_position.id or False
|
||||||
|
return {'value':{'partner_invoice_id': addr['invoice'], 'partner_order_id':addr['contact'], 'partner_shipping_id':addr['delivery'], 'pricelist_id': pricelist, 'payment_term' : payment_term, 'fiscal_position': fiscal_position}}
|
||||||
|
|
||||||
def shipping_policy_change(self, cr, uid, ids, policy, context={}):
|
def shipping_policy_change(self, cr, uid, ids, policy, context={}):
|
||||||
if not policy:
|
if not policy:
|
||||||
|
|
|
@ -206,6 +206,7 @@
|
||||||
<field groups="base.group_extended" name="origin"/>
|
<field groups="base.group_extended" name="origin"/>
|
||||||
<field groups="base.group_extended" name="invoice_quantity" attrs="{'readonly':[('order_policy','=','prepaid'),('order_policy','=','picking')]}"/>
|
<field groups="base.group_extended" name="invoice_quantity" attrs="{'readonly':[('order_policy','=','prepaid'),('order_policy','=','picking')]}"/>
|
||||||
<field name="payment_term"/>
|
<field name="payment_term"/>
|
||||||
|
<field name="fiscal_position"/>
|
||||||
<separator colspan="4" string="Notes"/>
|
<separator colspan="4" string="Notes"/>
|
||||||
<field colspan="4" name="note" nolabel="1"/>
|
<field colspan="4" name="note" nolabel="1"/>
|
||||||
</page>
|
</page>
|
||||||
|
|
Loading…
Reference in New Issue