Steps to reproduce the bug:
- Set your user in multi company
- Set a default analytic account A for product P with your company
- Create a PO with P and deliver it
- Generate the invoice.
Bug:
The analytic account A was not set on the line.
opw:1831998
The suggested analytic account must search based on the commercial_partner_id instead of
the partner_id field.
E.g. create an invoice with 'Agrolait, Thomas Passot', the analytic account 'Agrolait' wasn't set by default.
-github issue 21401
When migrating stock, some dummies methods have been removed. Indeed those
calls make more problems than they solve by adding unnecessary complexity
around simple methods. However it seems some calls have been left in the
process :
- _get_act_window_dict which is basically an env.ref or act_window.for_xml_id
- _get_products which is basically having all product_ids from template by
iterating on product_variant_ids.
Currently there is a selection field 'account_type' on the
account.analytic.account model with 2 values : Active or Archived
Let's use an active field instead and add a Archive stat button on the
form. That way, we can remove all the domain ('account_type','=','normal')
which are implicit with the generic active field behavior