← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 861306] Re: salesman for invoices created from a picking

 

Hello Devnani Bharat,

I have seen the diff. Could you please tell me why you changed on
sale/sale.py, onchange_partner_id:

user_id = uid

instead of what it was:

user_id = part.user_id and part.user_id.id or uid

I think it made more sense before: If the partner has a dedicated
salesman configured, use that. If not, use the current user. If not, I
think the user_id property for res.partner is not used in any other
place.

What I would change on sale/sale.py would be the _default for the
user_id field. Now it is:

'user_id': lambda obj, cr, uid, context: uid,

But to be more in sync with how it was before your change i would make
it to pick up the user_id if there is a partner_id in the context, like
it is done for partner_invoice_id.

Please comment. Thank you.

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/861306

Title:
  salesman for invoices created from a picking

Status in OpenERP Addons (modules):
  Fix Committed

Bug description:
  The salesman for the invoices created from a picking is not correct.

  When an invoice is created from a sale.order in the method
  action_invoice_create (sale/sale.py), the user_id field gets the
  value:

  'user_id': order.user_id and order.user_id.id or False

  so the code properly copies the salesman from the order to the
  invoice.

  However, when invoicing from pickings, the method
  action_invoice_create (stock/stock.py), the user_id field for the
  invoice gets the value:

  'user_id': uid

  when it should get the value:

  'user_id': picking.sale_id and picking.sale_id.user_id and
  picking.sale_id.user_id.id or False

  in the 2 locations of the method action_invoice_create.

  Please fix it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/861306/+subscriptions


References