Priyesh (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/6.0-opw-50768-pso into
lp:openobject-addons/6.0.
Requested reviews:
nel (nel-tinyerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-50768-pso/+merge/83775
Hello,
I have improved action_invoice_create method to fetch the correct user from the
Sale order instead of the user, who creates an invoice.
To reproduce, Here are the steps:
1. Create a SO with 'Invoice from the Picking' policy and set Salesman 'User A'
rather than Current user.
2. Confirm it and Process related Delivery order
3. After processing, Create an invoice.
4. Check the Salesman in invoice. It will be current user rather than Salesman
of SO
Kindly share your views on it.
Thanks,
Priyesh
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-50768-pso/+merge/83775
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.0-opw-50768-pso.
=== modified file 'stock/stock.py'
--- stock/stock.py 2011-11-17 13:08:26 +0000
+++ stock/stock.py 2011-11-29 12:54:41 +0000
@@ -988,6 +988,7 @@
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:
@@ -1016,7 +1017,7 @@
'origin': (invoice.origin or '') + ', ' + (picking.name or '') + (picking.origin and (':' + picking.origin) or ''),
'comment': (comment and (invoice.comment and invoice.comment+"\n"+comment or comment)) or (invoice.comment and invoice.comment or ''),
'date_invoice':context.get('date_inv',False),
- 'user_id':uid
+ 'user_id': picking.sale_id.user_id.id
}
invoice_obj.write(cr, uid, [invoice_id], invoice_vals, context=context)
else:
@@ -1033,7 +1034,7 @@
'fiscal_position': partner.property_account_position.id,
'date_invoice': context.get('date_inv',False),
'company_id': picking.company_id.id,
- 'user_id':uid
+ 'user_id': picking.sale_id.user_id.id
}
cur_id = self.get_currency_id(cr, uid, picking)
if cur_id:
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp