Skip to content
Snippets Groups Projects
Commit 83a7f8a2 authored by Jinjiu Liu's avatar Jinjiu Liu
Browse files

[FIX] delivery: add method to check if commercial invoice is needed

This is a side fix to add a helper method in delivery. The main fix is
here: https://github.com/odoo/enterprise/pull/34907

Also included the change when localization is IN, as when the ship_from
country is IN, the commercial invoice information is mandatory.
Reference is here: https://github.com/odoo/odoo/pull/82084 and https://github.com/odoo/odoo/pull/84159



opw-3031665

closes odoo/odoo#108490

X-original-commit: a72623c1
Related: odoo/enterprise#35167
Signed-off-by: default avatarTiffany Chang <tic@odoo.com>
parent 83d4a9be
No related branches found
No related tags found
No related merge requests found
......@@ -280,6 +280,10 @@ class StockPicking(models.Model):
weight += move.product_qty * move.product_id.weight
return weight
def _should_generate_commercial_invoice(self):
self.ensure_one()
return self.picking_type_id.warehouse_id.partner_id.country_id != self.partner_id.country_id
class StockReturnPicking(models.TransientModel):
_inherit = 'stock.return.picking'
......
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import stock_picking
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class StockPicking(models.Model):
_inherit = 'stock.picking'
def _should_generate_commercial_invoice(self):
super(StockPicking, self)._should_generate_commercial_invoice()
return True
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment