-
-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[14.0][MIG] product_analytic: Migration to 14.0 #375
Conversation
* OCA fixes * Analytic account creating invoice lines * Tests product_analytic: Add Antiun to authors
… to the one _get_product_accounts() of the account module product_analytic: add demo data Add modules product_analytic_pos and product_analytic_purchase
Currently translated at 100.0% (5 of 5 strings) Translation: account-analytic-11.0/account-analytic-11.0-product_analytic Translate-URL: https://translation.odoo-community.org/projects/account-analytic-11-0/account-analytic-11-0-product_analytic/ar/
Currently translated at 100,0% (5 of 5 strings) Translation: account-analytic-11.0/account-analytic-11.0-product_analytic Translate-URL: https://translation.odoo-community.org/projects/account-analytic-11-0/account-analytic-11-0-product_analytic/ca/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: account-analytic-12.0/account-analytic-12.0-product_analytic Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-product_analytic/
Currently translated at 100.0% (5 of 5 strings) Translation: account-analytic-12.0/account-analytic-12.0-product_analytic Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-product_analytic/pt_BR/
Currently translated at 60.0% (3 of 5 strings) Translation: account-analytic-12.0/account-analytic-12.0-product_analytic Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-product_analytic/fi/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: account-analytic-13.0/account-analytic-13.0-product_analytic Translate-URL: https://translation.odoo-community.org/projects/account-analytic-13-0/account-analytic-13-0-product_analytic/
Currently translated at 100.0% (5 of 5 strings) Translation: account-analytic-13.0/account-analytic-13.0-product_analytic Translate-URL: https://translation.odoo-community.org/projects/account-analytic-13-0/account-analytic-13-0-product_analytic/pt_BR/
Currently translated at 100.0% (5 of 5 strings) Translation: account-analytic-13.0/account-analytic-13.0-product_analytic Translate-URL: https://translation.odoo-community.org/projects/account-analytic-13-0/account-analytic-13-0-product_analytic/ca/
Currently translated at 100.0% (5 of 5 strings) Translation: account-analytic-13.0/account-analytic-13.0-product_analytic Translate-URL: https://translation.odoo-community.org/projects/account-analytic-13-0/account-analytic-13-0-product_analytic/es/
@api.model_create_multi | ||
def create(self, vals_list): | ||
for vals in vals_list: | ||
inv_type = self.env.context.get("inv_type", "out_invoice") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In v14 this context is always false, leading to setting by default the product's income analytic account in all the new account.move.line. It seems better to use directly the account.move's move_type
inv_type = self.env.context.get("inv_type", "out_invoice") | |
inv_type = self.env["account.move"].browse([vals.get("move_id")]).move_type |
inv_type = self.env.context.get("inv_type", "out_invoice") | ||
if ( | ||
vals.get("product_id") | ||
and inv_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and inv_type | |
and inv_type != "entry" |
It looks better to avoid adding defautl analytic.account on new internal account.move.line...
82b7659
to
b3c2263
Compare
Thank you for your review @clementmbr. I did your changes. Is possible you could review and approve this Pull request? |
In v14 ,An error occurred. The above exception was the direct cause of the following exception: Traceback (most recent call last): |
@billyang001 this field is added in the stock.picking model in the stock module from odoo. This module doesn't need this module to works correctly, so you must install stock module to solve your problem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@Reyes4711 Could you rebase ? |
@Reyes4711 @Du-ma I've done another PR based on this with some enhancments. If you can review and accept closing this one. |
Standard migration to 14.0