-
Notifications
You must be signed in to change notification settings - Fork 2
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
[13.0][IMP] logistics_planning_*: adds hook and unhook logistics with account move line #156
base: 13.0
Are you sure you want to change the base?
[13.0][IMP] logistics_planning_*: adds hook and unhook logistics with account move line #156
Conversation
logistics_planning_invoicing/wizards/logistics_schedule_existing_account_move_wizard.py
Outdated
Show resolved
Hide resolved
0cd25e7
to
c274a48
Compare
…isting account move
c274a48
to
7e4d271
Compare
@dalonsod can u review this? |
Not sure if current implementation for sales and purchase addons will work when analytic account is not filled in origin (an unexpected error could be raised, looking for |
product_id = fields.Many2one('product.product', related='logistics_schedule_id.product_id') | ||
carrier_id = fields.Many2one('res.partner', related='logistics_schedule_id.carrier_id') | ||
invoice_line_id = fields.Many2one('account.move.line', string="Invoice Line") | ||
domain_invoice_line_id = fields.Many2many('account.move.line', compute='_compute_domain_invoice_line_id') |
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.
Better naming:
domain_invoice_line_id = fields.Many2many('account.move.line', compute='_compute_domain_invoice_line_id') | |
domain_invoice_line_ids = fields.Many2many('account.move.line', compute='_compute_domain_invoice_line_ids') |
product_id = self.logistics_schedule_id._get_invoice_product() | ||
if not product_id: | ||
raise ValidationError(_("It is necessary to configure the default products of the logistics planning")) | ||
return [('move_id.partner_id', '=', self.carrier_id.id), ('product_id', '=', product_id.id)] |
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.
I miss a default condition: only select those move lines that actually are invoice lines (see https://github.com/odoo/odoo/blob/4cc086d330b73514fbc64a7fcf22d8a7a9f1b691/addons/account/models/account_move.py#L216)
Adds hook and unhook logistics with account move line