[FIX] misc fixes
bzr revid: fp@fp-laptop-20111201213212-7sn4d0e31pmc8a26
This commit is contained in:
commit
be78331f01
|
@ -242,6 +242,13 @@ class account_analytic_account(osv.osv):
|
|||
res['value']['partner_id'] = partner
|
||||
return res
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, partner, context=None):
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
if not partner:
|
||||
return {'value':{'contact_id': False}}
|
||||
address = partner_obj.address_get(cr, uid, [partner], ['contact'])
|
||||
return {'value':{'contact_id': address['contact']}}
|
||||
|
||||
def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
|
||||
if not args:
|
||||
args=[]
|
||||
|
|
|
@ -122,21 +122,5 @@
|
|||
<field name="employee_id" ref="hr.employee1"/>
|
||||
</record>
|
||||
|
||||
<!-- FIXME! Commented out to enable installation without creating conflicts
|
||||
during the first days of a month. To be properly fixed, see
|
||||
launchpad bug 791087!
|
||||
|
||||
<record id="attendance21" model="hr.attendance">
|
||||
<field eval="time.strftime('%Y-%m-%d 10:00')" name="name"/>
|
||||
<field name="action">sign_in</field>
|
||||
<field name="employee_id" ref="hr.employee1"/>
|
||||
</record>
|
||||
|
||||
<record id="attendance22" model="hr.attendance">
|
||||
<field eval="time.strftime('%Y-%m-%d 18:00')" name="name"/>
|
||||
<field name="action">sign_out</field>
|
||||
<field name="employee_id" ref="hr.employee1"/>
|
||||
</record>
|
||||
-->
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -989,7 +989,6 @@ class stock_picking(osv.osv):
|
|||
for picking in self.browse(cr, uid, ids, context=context):
|
||||
if picking.invoice_state != '2binvoiced':
|
||||
continue
|
||||
payment_term_id = False
|
||||
partner = picking.address_id and picking.address_id.partner_id
|
||||
if not partner:
|
||||
raise osv.except_osv(_('Error, no partner !'),
|
||||
|
@ -1000,10 +999,8 @@ class stock_picking(osv.osv):
|
|||
|
||||
if inv_type in ('out_invoice', 'out_refund'):
|
||||
account_id = partner.property_account_receivable.id
|
||||
payment_term_id = self._get_payment_term(cr, uid, picking)
|
||||
else:
|
||||
account_id = partner.property_account_payable.id
|
||||
|
||||
address_contact_id, address_invoice_id = \
|
||||
self._get_address_invoice(cr, uid, picking).values()
|
||||
address = address_obj.browse(cr, uid, address_contact_id, context=context)
|
||||
|
@ -1030,7 +1027,7 @@ class stock_picking(osv.osv):
|
|||
'address_invoice_id': address_invoice_id,
|
||||
'address_contact_id': address_contact_id,
|
||||
'comment': comment,
|
||||
'payment_term': payment_term_id,
|
||||
'payment_term': self._get_payment_term(cr, uid, picking),
|
||||
'fiscal_position': partner.property_account_position.id,
|
||||
'date_invoice': context.get('date_inv',False),
|
||||
'company_id': picking.company_id.id,
|
||||
|
@ -1811,7 +1808,7 @@ class stock_move(osv.osv):
|
|||
|
||||
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
|
||||
@param date_expected: Scheduled Date
|
||||
@param date: Move Date
|
||||
@return: Move Date
|
||||
"""
|
||||
|
@ -2706,7 +2703,7 @@ class stock_inventory_line(osv.osv):
|
|||
return {'value': {'product_qty': 0.0, 'product_uom': False}}
|
||||
obj_product = self.pool.get('product.product').browse(cr, uid, product)
|
||||
uom = uom or obj_product.uom_id.id
|
||||
amount = self.pool.get('stock.location')._product_get(cr, uid, location_id, [product], {'uom': uom, 'to_date': to_date})[product]
|
||||
amount = self.pool.get('stock.location')._product_get(cr, uid, location_id, [product], {'uom': uom, 'to_date': to_date, 'compute_child': False})[product]
|
||||
result = {'product_qty': amount, 'product_uom': uom}
|
||||
return {'value': result}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ class stock_invoice_onshipping(osv.osv_memory):
|
|||
if res:
|
||||
return res[0][0]
|
||||
return False
|
||||
|
||||
|
||||
def _get_journal_id(self, cr, uid, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
@ -46,6 +46,8 @@ class stock_invoice_onshipping(osv.osv_memory):
|
|||
browse_picking = model_pool.browse(cr, uid, res_ids, context=context)
|
||||
|
||||
for pick in browse_picking:
|
||||
if not pick.move_lines:
|
||||
continue
|
||||
src_usage = pick.move_lines[0].location_id.usage
|
||||
dest_usage = pick.move_lines[0].location_dest_id.usage
|
||||
type = pick.type
|
||||
|
@ -75,11 +77,11 @@ class stock_invoice_onshipping(osv.osv_memory):
|
|||
'group': fields.boolean("Group by partner"),
|
||||
'invoice_date': fields.date('Invoiced date'),
|
||||
}
|
||||
|
||||
|
||||
_defaults = {
|
||||
'journal_id' : _get_journal,
|
||||
}
|
||||
|
||||
|
||||
def view_init(self, cr, uid, fields_list, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
|
Loading…
Reference in New Issue