[IMP] sale: Change default invoicing policy

Purpose
=======
The default invoicing policy should be based on the delivered quantities
by default because:
- In countries with anglosaxon accounting, that's mandatory
- Even for other countries, it's probably as frequent as the "based on ordered"
  quantities

Task 2159161

closes odoo/odoo#47526

Related: odoo/enterprise#9355
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Lucas Lefèvre
2020-03-19 07:44:40 +00:00
committed by Lucas Lefèvre
parent 32b9c4a585
commit 3ad4abe171
6 changed files with 8 additions and 1 deletions
@@ -19,10 +19,12 @@ class StockMoveInvoice(AccountTestCommon):
self.product_cable_management_box = self.env['product.product'].create({
'name': 'Another product to deliver',
'weight': 1.0,
'invoice_policy': 'order',
})
self.product_uom_unit = self.env.ref('uom.product_uom_unit')
self.product_delivery_normal = self.env['product.product'].create({
'name': 'Normal Delivery Charges',
'invoice_policy': 'order',
'type': 'service',
'list_price': 10.0,
'categ_id': self.env.ref('delivery.product_category_deliveries').id,
+2
View File
@@ -16,5 +16,7 @@
<field name="key">sale.default_confirmation_template</field>
<field name="value" ref="sale.mail_template_sale_confirmation"/>
</record>
<function model="ir.default" name="set" eval="('product.template', 'invoice_policy', 'delivery')"/>
</data>
</odoo>
+1 -1
View File
@@ -21,7 +21,7 @@ class ResConfigSettings(models.TransientModel):
('order', 'Invoice what is ordered'),
('delivery', 'Invoice what is delivered')
], 'Invoicing Policy',
default='order',
default='delivery',
default_model='product.template')
deposit_default_product_id = fields.Many2one(
'product.product',
+1
View File
@@ -306,6 +306,7 @@ class TestSaleOrder(TestCommonSaleNoChart):
product_shared = self.env['product.template'].create({
'name': 'shared product',
'invoice_policy': 'order',
'taxes_id': [(6, False, [tax_company_1.id, tax_company_2.id])],
'property_account_income_id': self.account_receivable.id,
})
@@ -9,6 +9,7 @@ class TestSaleTransaction(AccountTestCommon):
def setUpClass(cls):
super(TestSaleTransaction, cls).setUpClass()
cls.product = cls.env['product.product'].create({
'invoice_policy': 'order',
'name': 'Product A',
})
cls.order = cls.env['sale.order'].create({
@@ -126,6 +126,7 @@ class TestSaleStock(TestSaleCommon):
advance_product = self.env['product.product'].create({
'name': 'Deposit',
'type': 'service',
'invoice_policy': 'order',
})
adv_wiz = self.env['sale.advance.payment.inv'].with_context(active_ids=[self.so.id]).create({
'advance_payment_method': 'percentage',