From a202690c16f187909dfa0500dc5554d51485d80d Mon Sep 17 00:00:00 2001
From: Kitti U
Date: Wed, 12 Jun 2019 22:05:11 +0700
Subject: [PATCH 01/67] [12.0][ADD] purchase_deposit
---
purchase_deposit/__init__.py | 6 +
purchase_deposit/__manifest__.py | 23 +++
purchase_deposit/models/__init__.py | 7 +
purchase_deposit/models/invoice.py | 16 ++
purchase_deposit/models/purchase.py | 28 +++
.../models/res_config_settings.py | 17 ++
purchase_deposit/readme/CONFIGURATION.rst | 7 +
purchase_deposit/readme/CONTRIBUTORS.rst | 2 +
purchase_deposit/readme/DESCRIPTION.rst | 1 +
purchase_deposit/readme/USAGE.rst | 9 +
purchase_deposit/tests/__init__.py | 5 +
.../tests/test_purchase_deposit.py | 134 ++++++++++++
purchase_deposit/views/purchase_view.xml | 17 ++
.../views/res_config_settings_views.xml | 27 +++
purchase_deposit/wizard/__init__.py | 5 +
.../wizard/purchase_make_invoice_advance.py | 192 ++++++++++++++++++
.../purchase_make_invoice_advance_views.xml | 41 ++++
17 files changed, 537 insertions(+)
create mode 100644 purchase_deposit/__init__.py
create mode 100644 purchase_deposit/__manifest__.py
create mode 100644 purchase_deposit/models/__init__.py
create mode 100644 purchase_deposit/models/invoice.py
create mode 100644 purchase_deposit/models/purchase.py
create mode 100644 purchase_deposit/models/res_config_settings.py
create mode 100644 purchase_deposit/readme/CONFIGURATION.rst
create mode 100644 purchase_deposit/readme/CONTRIBUTORS.rst
create mode 100644 purchase_deposit/readme/DESCRIPTION.rst
create mode 100644 purchase_deposit/readme/USAGE.rst
create mode 100644 purchase_deposit/tests/__init__.py
create mode 100644 purchase_deposit/tests/test_purchase_deposit.py
create mode 100644 purchase_deposit/views/purchase_view.xml
create mode 100644 purchase_deposit/views/res_config_settings_views.xml
create mode 100644 purchase_deposit/wizard/__init__.py
create mode 100644 purchase_deposit/wizard/purchase_make_invoice_advance.py
create mode 100644 purchase_deposit/wizard/purchase_make_invoice_advance_views.xml
diff --git a/purchase_deposit/__init__.py b/purchase_deposit/__init__.py
new file mode 100644
index 00000000000..3a8c5973678
--- /dev/null
+++ b/purchase_deposit/__init__.py
@@ -0,0 +1,6 @@
+# Copyright 2019 Elico Corp, Dominique K.
+# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from . import models
+from . import wizard
diff --git a/purchase_deposit/__manifest__.py b/purchase_deposit/__manifest__.py
new file mode 100644
index 00000000000..2103cddd870
--- /dev/null
+++ b/purchase_deposit/__manifest__.py
@@ -0,0 +1,23 @@
+# Copyright 2019 Elico Corp, Dominique K.
+# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+{
+ 'name': 'Purchase Deposit',
+ 'version': '12.0.1.0.0',
+ 'summary': 'Option to create deposit from purchase order',
+ 'author': 'Elico Corp, Ecosoft, Odoo Community Association (OCA)',
+ 'website': 'https://github.com/OCA/purchase-workflow',
+ 'category': 'Purchase Management',
+ 'license': 'AGPL-3',
+ 'depends': [
+ 'purchase',
+ ],
+ 'data': [
+ 'wizard/purchase_make_invoice_advance_views.xml',
+ 'views/res_config_settings_views.xml',
+ 'views/purchase_view.xml',
+ ],
+ 'installable': True,
+ 'auto_install': False,
+}
diff --git a/purchase_deposit/models/__init__.py b/purchase_deposit/models/__init__.py
new file mode 100644
index 00000000000..4cfb36fd4df
--- /dev/null
+++ b/purchase_deposit/models/__init__.py
@@ -0,0 +1,7 @@
+# Copyright 2019 Elico Corp, Dominique K.
+# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from . import res_config_settings
+from . import purchase
+from . import invoice
diff --git a/purchase_deposit/models/invoice.py b/purchase_deposit/models/invoice.py
new file mode 100644
index 00000000000..22da25bd8e5
--- /dev/null
+++ b/purchase_deposit/models/invoice.py
@@ -0,0 +1,16 @@
+# Copyright 2019 Elico Corp, Dominique K.
+# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from odoo import models
+
+
+class AccountInvoice(models.Model):
+ _inherit = 'account.invoice'
+
+ def _prepare_invoice_line_from_po_line(self, line):
+ res = super(AccountInvoice, self).\
+ _prepare_invoice_line_from_po_line(line)
+ if line.is_deposit:
+ res['quantity'] = -1 * line.qty_invoiced
+ return res
diff --git a/purchase_deposit/models/purchase.py b/purchase_deposit/models/purchase.py
new file mode 100644
index 00000000000..c31c4a41890
--- /dev/null
+++ b/purchase_deposit/models/purchase.py
@@ -0,0 +1,28 @@
+# Copyright 2019 Elico Corp, Dominique K.
+# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from odoo import api, fields, models
+
+
+class PurchaseOrder(models.Model):
+ _inherit = 'purchase.order'
+
+ @api.multi
+ def copy_data(self, default=None):
+ if default is None:
+ default = {}
+ default['order_line'] = \
+ [(0, 0, line.copy_data()[0])
+ for line in self.order_line.filtered(lambda l: not l.is_deposit)]
+ return super(PurchaseOrder, self).copy_data(default)
+
+
+class PurchaseOrderLine(models.Model):
+ _inherit = 'purchase.order.line'
+
+ is_deposit = fields.Boolean(
+ string='Is a deposit payment',
+ help="Deposit payments are made when creating invoices from a purhcase"
+ " order. They are not copied when duplicating a purchase order.",
+ )
diff --git a/purchase_deposit/models/res_config_settings.py b/purchase_deposit/models/res_config_settings.py
new file mode 100644
index 00000000000..7628530117b
--- /dev/null
+++ b/purchase_deposit/models/res_config_settings.py
@@ -0,0 +1,17 @@
+# Copyright 2019 Elico Corp, Dominique K.
+# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from odoo import models, fields
+
+
+class ResConfigSettings(models.TransientModel):
+ _inherit = 'res.config.settings'
+
+ default_purchase_deposit_product_id = fields.Many2one(
+ comodel_name='product.product',
+ string='Purchase Deposit Product',
+ default_model='purchase.advance.payment.inv',
+ domain=[('type', '=', 'service')],
+ help="Default product used for payment advances.",
+ )
diff --git a/purchase_deposit/readme/CONFIGURATION.rst b/purchase_deposit/readme/CONFIGURATION.rst
new file mode 100644
index 00000000000..ebdedd23334
--- /dev/null
+++ b/purchase_deposit/readme/CONFIGURATION.rst
@@ -0,0 +1,7 @@
+After install this module, you need to select the product "Purchase Deposit" in
+configuration window to be used as default product when create deposit invoice.
+
+Go to Purchase > Configuration > Settings, then select product "Purchase Deposit"
+
+Note: If this is not done, by using "Register Deposit" for the first time will
+also create product "Purchase Deposit" for you automatically.
diff --git a/purchase_deposit/readme/CONTRIBUTORS.rst b/purchase_deposit/readme/CONTRIBUTORS.rst
new file mode 100644
index 00000000000..5673dd01dc8
--- /dev/null
+++ b/purchase_deposit/readme/CONTRIBUTORS.rst
@@ -0,0 +1,2 @@
+* Dominique K.
+* Kitti Upariphutthiphong
diff --git a/purchase_deposit/readme/DESCRIPTION.rst b/purchase_deposit/readme/DESCRIPTION.rst
new file mode 100644
index 00000000000..6c3209c6d2b
--- /dev/null
+++ b/purchase_deposit/readme/DESCRIPTION.rst
@@ -0,0 +1 @@
+This module allow purchase order to register deposit similar to that in sales order
diff --git a/purchase_deposit/readme/USAGE.rst b/purchase_deposit/readme/USAGE.rst
new file mode 100644
index 00000000000..74ee733d7de
--- /dev/null
+++ b/purchase_deposit/readme/USAGE.rst
@@ -0,0 +1,9 @@
+When purchase order is confirmed, a new button "Register Deposit" will appear.
+Normally, deposit will be used to create the 1st invoice (as deposit).
+
+#. On confirmed purchase order, click Register Deposit button, wizard will open
+#. 2 type of deposit invoice can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
+#. Fill in the value and click Create Invoice button.
+
+As deposit is created, when user click button "Create Bill" again in purchase order,
+the Vendor Bill will be created with deposit amount deducted.
diff --git a/purchase_deposit/tests/__init__.py b/purchase_deposit/tests/__init__.py
new file mode 100644
index 00000000000..78727aba356
--- /dev/null
+++ b/purchase_deposit/tests/__init__.py
@@ -0,0 +1,5 @@
+# Copyright 2019 Elico Corp, Dominique K.
+# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from . import test_purchase_deposit
diff --git a/purchase_deposit/tests/test_purchase_deposit.py b/purchase_deposit/tests/test_purchase_deposit.py
new file mode 100644
index 00000000000..0f9a48afd91
--- /dev/null
+++ b/purchase_deposit/tests/test_purchase_deposit.py
@@ -0,0 +1,134 @@
+# Copyright 2019 Elico Corp, Dominique K.
+# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from odoo import fields
+from odoo.tests.common import TransactionCase
+from odoo.exceptions import UserError
+from odoo.tests.common import Form
+
+
+class TestPurchaseDeposit(TransactionCase):
+
+ def setUp(self):
+ super(TestPurchaseDeposit, self).setUp()
+ self.product_model = self.env['product.product']
+ self.account_model = self.env['account.account']
+ self.invoice_model = self.env['account.invoice']
+ self.default_model = self.env['ir.default']
+
+ # Create Deposit Account
+ self.account_deposit = self.account_model.create({
+ 'name': 'Purchase Deposit',
+ 'code': '11620',
+ 'user_type_id': self.env.ref(
+ 'account.data_account_type_current_assets').id,
+ })
+ # Create products:
+ p1 = self.product1 = self.product_model.create({
+ 'name': 'Test Product 1',
+ 'type': 'service',
+ 'default_code': 'PROD1',
+ 'purchase_method': 'purchase',
+ })
+
+ self.po = self.env['purchase.order'].create({
+ 'partner_id': self.ref('base.res_partner_3'),
+ 'order_line': [
+ (0, 0, {'product_id': p1.id,
+ 'product_uom': p1.uom_id.id,
+ 'name': p1.name,
+ 'price_unit': 100.0,
+ 'date_planned': fields.Datetime.now(),
+ 'product_qty': 42.0})]})
+
+ def test_create_deposit_invoice(self):
+ self.assertEqual(len(self.po.order_line), 1)
+ # We create invoice from expense
+ ctx = {'active_id': self.po.id,
+ 'active_ids': [self.po.id],
+ 'active_model': 'purchase.order'}
+ CreateDeposit = self.env['purchase.advance.payment.inv']
+ self.po.button_confirm()
+ with Form(CreateDeposit.with_context(ctx)) as f:
+ f.advance_payment_method = 'percentage'
+ f.deposit_account_id = self.account_deposit
+ wizard = f.save()
+ wizard.amount = 10.0 # 10%
+ wizard.create_invoices()
+ # New Purchase Deposit is created automatically
+ deposit_id = self.default_model.get('purchase.advance.payment.inv',
+ 'purchase_deposit_product_id')
+ deposit = self.product_model.browse(deposit_id)
+ self.assertEqual(deposit.name, 'Purchase Deposit')
+ # 1 Deposit Invoice is created
+ self.assertRecordValues(self.po.invoice_ids.invoice_line_ids, [
+ {'product_id': deposit.id,
+ 'price_unit': 420.0, 'name': 'Deposit Payment', },
+ ])
+ # On Purchase Order, there will be new deposit line create
+ self.assertRecordValues(self.po.order_line, [
+ {'product_id': self.product1.id,
+ 'price_unit': 100.0, 'is_deposit': False},
+ {'product_id': deposit.id,
+ 'price_unit': 420.0, 'is_deposit': True},
+ ])
+ # On Purchase Order, create normal billing
+ res = self.po.with_context(create_bill=True).action_view_invoice()
+ ctx = res.get('context')
+ f = Form(self.invoice_model.with_context(ctx),
+ view='account.invoice_supplier_form')
+ invoice = f.save()
+ self.assertRecordValues(invoice.invoice_line_ids, [
+ {'product_id': self.product1.id,
+ 'price_unit': 100.0, 'quantity': 42},
+ {'product_id': deposit.id,
+ 'price_unit': 420.0, 'quantity': -1},
+ ])
+
+ def test_create_deposit_invoice_exception(self):
+ """This test focus on exception cases, when create deposit invoice,
+ 1. This action is allowed only in Purchase Order sate
+ 2. The value of the deposit must be positive
+ 3. For type percentage, The percentage of the deposit must <= 100
+ 4. Purchase Deposit Product's purchase_method != purchase
+ 5. Purchase Deposit Product's type != service
+ """
+ self.assertEqual(len(self.po.order_line), 1)
+ # We create invoice from expense
+ ctx = {'active_id': self.po.id,
+ 'active_ids': [self.po.id],
+ 'active_model': 'purchase.order'}
+ CreateDeposit = self.env['purchase.advance.payment.inv']
+ # 1. This action is allowed only in Purchase Order sate
+ with self.assertRaises(UserError):
+ Form(CreateDeposit.with_context(ctx)) # Initi wizard
+ self.po.button_confirm()
+ self.assertEqual(self.po.state, 'purchase')
+ # 2. The value of the deposit must be positive
+ f = Form(CreateDeposit.with_context(ctx))
+ f.advance_payment_method = 'fixed'
+ f.amount = 0.0
+ f.deposit_account_id = self.account_deposit
+ wizard = f.save()
+ with self.assertRaises(UserError):
+ wizard.create_invoices()
+ # 3. For type percentage, The percentage of the deposit must <= 100
+ wizard.advance_payment_method = 'percentage'
+ wizard.amount = 101.0
+ with self.assertRaises(UserError):
+ wizard.create_invoices()
+ wizard.amount = 10
+ # 4. Purchase Deposit Product's purchase_method != purchase
+ deposit_id = self.default_model.get('purchase.advance.payment.inv',
+ 'purchase_deposit_product_id')
+ deposit = self.product_model.browse(deposit_id)
+ deposit.purchase_method = 'receive'
+ wizard.purchase_deposit_product_id = deposit
+ with self.assertRaises(UserError):
+ wizard.create_invoices()
+ deposit.purchase_method = 'purchase'
+ # 5. Purchase Deposit Product's type != service
+ deposit.type = 'consu'
+ with self.assertRaises(UserError):
+ wizard.create_invoices()
diff --git a/purchase_deposit/views/purchase_view.xml b/purchase_deposit/views/purchase_view.xml
new file mode 100644
index 00000000000..55f59408d94
--- /dev/null
+++ b/purchase_deposit/views/purchase_view.xml
@@ -0,0 +1,17 @@
+
+
+
+
+ view.purchase.order.inherit
+ purchase.order
+ form
+
+
+
+
+
+
+
+
+
diff --git a/purchase_deposit/views/res_config_settings_views.xml b/purchase_deposit/views/res_config_settings_views.xml
new file mode 100644
index 00000000000..8c01561ff34
--- /dev/null
+++ b/purchase_deposit/views/res_config_settings_views.xml
@@ -0,0 +1,27 @@
+
+
+
+
+ res.config.settings.view.form.inherit.purchase
+ res.config.settings
+
+
+
+
+
+
+
+
+
+ Product used for deposit payments
+
+
+
+
+
+
+
+
+
+
+
diff --git a/purchase_deposit/wizard/__init__.py b/purchase_deposit/wizard/__init__.py
new file mode 100644
index 00000000000..e49b2a25f1f
--- /dev/null
+++ b/purchase_deposit/wizard/__init__.py
@@ -0,0 +1,5 @@
+# Copyright 2019 Elico Corp, Dominique K.
+# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from . import purchase_make_invoice_advance
diff --git a/purchase_deposit/wizard/purchase_make_invoice_advance.py b/purchase_deposit/wizard/purchase_make_invoice_advance.py
new file mode 100644
index 00000000000..6f922f2b751
--- /dev/null
+++ b/purchase_deposit/wizard/purchase_make_invoice_advance.py
@@ -0,0 +1,192 @@
+# Copyright 2019 Elico Corp, Dominique K.
+# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+import time
+
+from odoo import api, fields, models, _
+from odoo.exceptions import UserError
+
+
+class PurchaseAdvancePaymentInv(models.TransientModel):
+ _name = 'purchase.advance.payment.inv'
+ _description = 'Purchase Advance Payment Invoice'
+
+ advance_payment_method = fields.Selection(
+ [('percentage', 'Down payment (percentage)'),
+ ('fixed', 'Deposit payment (fixed amount)')],
+ string='What do you want to invoice?',
+ default='percentage',
+ required=True,
+ )
+ purchase_deposit_product_id = fields.Many2one(
+ comodel_name='product.product',
+ string='Deposit Payment Product',
+ domain=[('type', '=', 'service')],
+ )
+ amount = fields.Float(
+ string='Deposit Payment Amount',
+ required=True,
+ help="The amount to be invoiced in advance, taxes excluded.",
+ )
+ deposit_account_id = fields.Many2one(
+ comodel_name='account.account',
+ string='Expense Account',
+ domain=[('deprecated', '=', False)],
+ help="Account used for deposits",
+ )
+ deposit_taxes_id = fields.Many2many(
+ comodel_name='account.tax',
+ string='Vendor Taxes',
+ help="Taxes used for deposits",
+ )
+
+ @api.model
+ def view_init(self, fields):
+ active_id = self._context.get('active_id')
+ purchase = self.env['purchase.order'].browse(active_id)
+ if purchase.state != 'purchase':
+ raise UserError(
+ _('This action is allowed only in Purchase Order sate'))
+ return super().view_init(fields)
+
+ @api.onchange('purchase_deposit_product_id')
+ def _onchagne_purchase_deposit_product_id(self):
+ product = self.purchase_deposit_product_id
+ self.deposit_account_id = product.property_account_expense_id
+ self.deposit_taxes_id = product.supplier_taxes_id
+
+ @api.multi
+ def _create_invoice(self, order, po_line, amount):
+ Invoice = self.env['account.invoice']
+ ir_property_obj = self.env['ir.property']
+ account_id = False
+ product = self.purchase_deposit_product_id
+ if product.id:
+ account_id = product.property_account_expense_id.id or \
+ product.categ_id.property_account_expense_categ_id.id
+ if not account_id:
+ inc_acc = ir_property_obj.get('property_account_expense_categ_id',
+ 'product.category')
+ account_id = order.fiscal_position_id.map_account(inc_acc).id \
+ if inc_acc else False
+ if not account_id:
+ raise UserError(
+ _('There is no purchase account defined for this product: %s.'
+ '\nYou may have to install a chart of account from '
+ 'Accounting app, settings menu.') % (product.name,))
+
+ if self.amount <= 0:
+ raise UserError(_('The value of the deposit must be positive.'))
+ context = {'lang': order.partner_id.lang}
+ amount = self.amount
+ if self.advance_payment_method == 'percentage': # Case percent
+ if self.amount > 100:
+ raise UserError(
+ _('The percentage of the deposit must be not over 100'))
+ amount = self.amount/100 * order.amount_untaxed
+ name = _('Deposit Payment')
+ del context
+ taxes = product.supplier_taxes_id.filtered(
+ lambda r: not order.company_id or r.company_id == order.company_id)
+ if order.fiscal_position_id and taxes:
+ tax_ids = order.fiscal_position_id.map_tax(taxes).ids
+ else:
+ tax_ids = taxes.ids
+
+ invoice = Invoice.create({
+ 'name': order.name,
+ 'origin': order.name,
+ 'type': 'in_invoice',
+ 'reference': False,
+ 'account_id': order.partner_id.property_account_payable_id.id,
+ 'partner_id': order.partner_id.id,
+ 'invoice_line_ids': [(0, 0, {
+ 'name': name,
+ 'origin': order.name,
+ 'account_id': account_id,
+ 'price_unit': amount,
+ 'quantity': 1.0,
+ 'uom_id': product.uom_id.id,
+ 'product_id': product.id,
+ 'purchase_line_id': po_line.id,
+ 'invoice_line_tax_ids': [(6, 0, tax_ids)],
+ 'account_analytic_id': po_line.account_analytic_id.id or False,
+ })],
+ 'currency_id': order.currency_id.id,
+ 'payment_term_id': order.payment_term_id.id,
+ 'fiscal_position_id': order.fiscal_position_id.id or
+ order.partner_id.property_account_position_id.id,
+ 'purchase_id': order.id,
+ 'comment': order.notes,
+ })
+ invoice.compute_taxes()
+ invoice.message_post_with_view(
+ 'mail.message_origin_link',
+ values={'self': invoice, 'origin': order},
+ subtype_id=self.env.ref('mail.mt_note').id)
+ return invoice
+
+ @api.multi
+ def create_invoices(self):
+ Purchase = self.env['purchase.order']
+ IrDefault = self.env['ir.default'].sudo()
+ purchases = Purchase.browse(self._context.get('active_ids', []))
+ # Create deposit product if necessary
+ product = self.purchase_deposit_product_id
+ if not product:
+ vals = self._prepare_deposit_product()
+ product = self.purchase_deposit_product_id = \
+ self.env['product.product'].create(vals)
+ IrDefault.set('purchase.advance.payment.inv',
+ 'purchase_deposit_product_id', product.id)
+ PurchaseLine = self.env['purchase.order.line']
+ for order in purchases:
+ amount = self.amount
+ if self.advance_payment_method == 'percentage': # Case percent
+ amount = self.amount/100 * order.amount_untaxed
+ if product.purchase_method != 'purchase':
+ raise UserError(
+ _('The product used to invoice a down payment should have '
+ 'an invoice policy set to "Ordered quantities". '
+ 'Please update your deposit product to be able to '
+ 'create a deposit invoice.'))
+ if product.type != 'service':
+ raise UserError(
+ _('The product used to invoice a down payment should be '
+ 'of type "Service". Please use another product or '
+ 'update this product.'))
+ taxes = product.supplier_taxes_id.filtered(
+ lambda r: not order.company_id or
+ r.company_id == order.company_id)
+ if order.fiscal_position_id and taxes:
+ tax_ids = order.fiscal_position_id.map_tax(taxes).ids
+ else:
+ tax_ids = taxes.ids
+ context = {'lang': order.partner_id.lang}
+ po_line = PurchaseLine.create({
+ 'name': _('Advance: %s') % (time.strftime('%m %Y'),),
+ 'price_unit': amount,
+ 'product_qty': 0.0,
+ 'order_id': order.id,
+ 'product_uom': product.uom_id.id,
+ 'product_id': product.id,
+ 'taxes_id': [(6, 0, tax_ids)],
+ 'date_planned': order.date_planned,
+ 'is_deposit': True,
+ })
+ del context
+ self._create_invoice(order, po_line, amount)
+ if self._context.get('open_invoices', False):
+ return purchases.action_view_invoice()
+ return {'type': 'ir.actions.act_window_close'}
+
+ def _prepare_deposit_product(self):
+ return {
+ 'name': 'Purchase Deposit',
+ 'type': 'service',
+ 'purchase_method': 'purchase',
+ 'property_account_expense_id': self.deposit_account_id.id,
+ 'supplier_taxes_id': [(6, 0, self.deposit_taxes_id.ids)],
+ 'company_id': False,
+ }
diff --git a/purchase_deposit/wizard/purchase_make_invoice_advance_views.xml b/purchase_deposit/wizard/purchase_make_invoice_advance_views.xml
new file mode 100644
index 00000000000..34988218708
--- /dev/null
+++ b/purchase_deposit/wizard/purchase_make_invoice_advance_views.xml
@@ -0,0 +1,41 @@
+
+
+
+
+ Invoice Orders
+ purchase.advance.payment.inv
+
+
+
+
+
+
+ Invoice Order
+ ir.actions.act_window
+ purchase.advance.payment.inv
+ form
+ form
+ new
+
+
+
From a3c3abc82c5b75cc5e31e58efd342ea69f837858 Mon Sep 17 00:00:00 2001
From: oca-travis
Date: Thu, 10 Oct 2019 06:19:53 +0000
Subject: [PATCH 02/67] [UPD] Update purchase_deposit.pot
---
purchase_deposit/i18n/purchase_deposit.pot | 239 +++++++++++++++++++++
1 file changed, 239 insertions(+)
create mode 100644 purchase_deposit/i18n/purchase_deposit.pot
diff --git a/purchase_deposit/i18n/purchase_deposit.pot b/purchase_deposit/i18n/purchase_deposit.pot
new file mode 100644
index 00000000000..cfbd565c449
--- /dev/null
+++ b/purchase_deposit/i18n/purchase_deposit.pot
@@ -0,0 +1,239 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * purchase_deposit
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 12.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
+msgid "Account used for deposits"
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:168
+#, python-format
+msgid "Advance: %s"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Cancel"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_res_config_settings
+msgid "Config Settings"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Create Invoices"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Create and View Invoices"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_uid
+msgid "Created by"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_date
+msgid "Created on"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_res_config_settings__default_purchase_deposit_product_id
+msgid "Default product used for payment advances."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:88
+#, python-format
+msgid "Deposit Payment"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__amount
+msgid "Deposit Payment Amount"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__purchase_deposit_product_id
+msgid "Deposit Payment Product"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
+msgid "Deposit Payments"
+msgstr ""
+
+#. module: purchase_deposit
+#: selection:purchase.advance.payment.inv,advance_payment_method:0
+msgid "Deposit payment (fixed amount)"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_order_line__is_deposit
+msgid "Deposit payments are made when creating invoices from a purhcase order. They are not copied when duplicating a purchase order."
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__display_name
+msgid "Display Name"
+msgstr ""
+
+#. module: purchase_deposit
+#: selection:purchase.advance.payment.inv,advance_payment_method:0
+msgid "Down payment (percentage)"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
+msgid "Expense Account"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__id
+msgid "ID"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_account_invoice
+msgid "Invoice"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.actions.act_window,name:purchase_deposit.action_view_purchase_advance_payment_inv
+msgid "Invoice Order"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Invoice Purchases Order"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Invoices will be created in draft so that you can review them before validation."
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__is_deposit
+msgid "Is a deposit payment"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv____last_update
+msgid "Last Modified on"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__write_uid
+msgid "Last Updated by"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__write_date
+msgid "Last Updated on"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
+msgid "Product used for deposit payments"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_purchase_advance_payment_inv
+msgid "Purchase Advance Payment Invoice"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__default_purchase_deposit_product_id
+msgid "Purchase Deposit Product"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_purchase_order
+msgid "Purchase Order"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_purchase_order_line
+msgid "Purchase Order Line"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_order_form_inherit
+msgid "Register Deposit"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_taxes_id
+msgid "Taxes used for deposits"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__amount
+msgid "The amount to be invoiced in advance, taxes excluded."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:86
+#, python-format
+msgid "The percentage of the deposit must be not over 100"
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:156
+#, python-format
+msgid "The product used to invoice a down payment should be of type \"Service\". Please use another product or update this product."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:150
+#, python-format
+msgid "The product used to invoice a down payment should have an invoice policy set to \"Ordered quantities\". Please update your deposit product to be able to create a deposit invoice."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:80
+#, python-format
+msgid "The value of the deposit must be positive."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:75
+#, python-format
+msgid "There is no purchase account defined for this product: %s.\n"
+"You may have to install a chart of account from Accounting app, settings menu."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:50
+#, python-format
+msgid "This action is allowed only in Purchase Order sate"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__deposit_taxes_id
+msgid "Vendor Taxes"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__advance_payment_method
+msgid "What do you want to invoice?"
+msgstr ""
+
From c3da89a93ea73f4e30ae520033a22325f24401c4 Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Thu, 10 Oct 2019 06:55:27 +0000
Subject: [PATCH 03/67] [UPD] README.rst
---
purchase_deposit/README.rst | 88 ++++
.../static/description/index.html | 434 ++++++++++++++++++
2 files changed, 522 insertions(+)
create mode 100644 purchase_deposit/README.rst
create mode 100644 purchase_deposit/static/description/index.html
diff --git a/purchase_deposit/README.rst b/purchase_deposit/README.rst
new file mode 100644
index 00000000000..7cea7aa39f8
--- /dev/null
+++ b/purchase_deposit/README.rst
@@ -0,0 +1,88 @@
+================
+Purchase Deposit
+================
+
+.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! This file is generated by oca-gen-addon-readme !!
+ !! changes will be overwritten. !!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
+ :target: https://odoo-community.org/page/development-status
+ :alt: Beta
+.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ :alt: License: AGPL-3
+.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
+ :target: https://github.com/OCA/purchase-workflow/tree/12.0/purchase_deposit
+ :alt: OCA/purchase-workflow
+.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
+ :target: https://translation.odoo-community.org/projects/purchase-workflow-12-0/purchase-workflow-12-0-purchase_deposit
+ :alt: Translate me on Weblate
+.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
+ :target: https://runbot.odoo-community.org/runbot/142/12.0
+ :alt: Try me on Runbot
+
+|badge1| |badge2| |badge3| |badge4| |badge5|
+
+This module allow purchase order to register deposit similar to that in sales order
+
+**Table of contents**
+
+.. contents::
+ :local:
+
+Usage
+=====
+
+When purchase order is confirmed, a new button "Register Deposit" will appear.
+Normally, deposit will be used to create the 1st invoice (as deposit).
+
+#. On confirmed purchase order, click Register Deposit button, wizard will open
+#. 2 type of deposit invoice can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
+#. Fill in the value and click Create Invoice button.
+
+As deposit is created, when user click button "Create Bill" again in purchase order,
+the Vendor Bill will be created with deposit amount deducted.
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub Issues `_.
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us smashing it by providing a detailed and welcomed
+`feedback `_.
+
+Do not contact contributors directly about support or help with technical issues.
+
+Credits
+=======
+
+Authors
+~~~~~~~
+
+* Elico Corp
+* Ecosoft
+
+Contributors
+~~~~~~~~~~~~
+
+* Dominique K.
+* Kitti Upariphutthiphong
+
+Maintainers
+~~~~~~~~~~~
+
+This module is maintained by the OCA.
+
+.. image:: https://odoo-community.org/logo.png
+ :alt: Odoo Community Association
+ :target: https://odoo-community.org
+
+OCA, or the Odoo Community Association, is a nonprofit organization whose
+mission is to support the collaborative development of Odoo features and
+promote its widespread use.
+
+This module is part of the `OCA/purchase-workflow `_ project on GitHub.
+
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/purchase_deposit/static/description/index.html b/purchase_deposit/static/description/index.html
new file mode 100644
index 00000000000..335a9fbd651
--- /dev/null
+++ b/purchase_deposit/static/description/index.html
@@ -0,0 +1,434 @@
+
+
+
+
+
+
+Purchase Deposit
+
+
+
+
+
Purchase Deposit
+
+
+
+
This module allow purchase order to register deposit similar to that in sales order
+
Table of contents
+
+
+
+
When purchase order is confirmed, a new button “Register Deposit” will appear.
+Normally, deposit will be used to create the 1st invoice (as deposit).
+
+On confirmed purchase order, click Register Deposit button, wizard will open
+2 type of deposit invoice can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
+Fill in the value and click Create Invoice button.
+
+
As deposit is created, when user click button “Create Bill” again in purchase order,
+the Vendor Bill will be created with deposit amount deducted.
+
+
+
+
Bugs are tracked on GitHub Issues .
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us smashing it by providing a detailed and welcomed
+feedback .
+
Do not contact contributors directly about support or help with technical issues.
+
+
+
+
+
+
+
+
This module is maintained by the OCA.
+
+
OCA, or the Odoo Community Association, is a nonprofit organization whose
+mission is to support the collaborative development of Odoo features and
+promote its widespread use.
+
This module is part of the OCA/purchase-workflow project on GitHub.
+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute .
+
+
+
+
+
From 52f5cf55abf2a2f379833c7a97a1765624bbe21f Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Thu, 10 Oct 2019 06:55:28 +0000
Subject: [PATCH 04/67] [ADD] icon.png
---
purchase_deposit/static/description/icon.png | Bin 0 -> 9455 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 purchase_deposit/static/description/icon.png
diff --git a/purchase_deposit/static/description/icon.png b/purchase_deposit/static/description/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d
GIT binary patch
literal 9455
zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~!
zVpnB`o+K7|Al`Q_U;eD$B
zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA
z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__
zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_
zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I
z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U
z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)(
z;)z%wI5>D4a*5XwD)P--sPkoY(a~WBw;E~AW`Yue4kFa^LM3X`8x|}ZUeMnqr}>kH
zG%WWW>3ml$Yez?i%)2pbKPI7?5o?hydokgQyZsNEr{a|mLdt;X2TX(#B1j35xPnPW
z*bMSSOauW>o;*=kO8ojw91VX!qoOQb)zHJ!odWB}d+*K?#sY_jqPdg{Sm2HdYzdEx
zOGVPhVRTGPtv0o}RfVP;Nd(|CB)I;*t&QO8h
zFfekr30S!-LHmV_Su-W+rEwYXJ^;6&3|L$mMC8*bQptyOo9;>Qb9Q9`ySe3%V$A*9
zeKEe+b0{#KWGp$F+tga)0RtI)nhMa-K@JS}2krK~n8vJ=Ngm?R!9G<~RyuU0d?nz#
z-5EK$o(!F?hmX*2Yt6+coY`6jGbb7tF#6nHA
zuKk=GGJ;ZwON1iAfG$E#Y7MnZVmrY|j0eVI(DN_MNFJmyZ|;w4tf@=CCDZ#5N_0K=
z$;R~bbk?}TpfDjfB&aiQ$VA}s?P}xPERJG{kxk5~R`iRS(SK5d+Xs9swCozZISbnS
zk!)I0>t=A<-^z(cmSFz3=jZ23u13X><0b)P)^1T_))Kr`e!-pb#q&J*Q`p+B6la%C
zuVl&0duN<;uOsB3%T9Fp8t{ED108)`y_~Hnd9AUX7h-H?jVuU|}My+C=TjH(jKz
zqMVr0re3S$H@t{zI95qa)+Crz*5Zj}Ao%4Z><+W(nOZd?gDnfNBC3>M8WE61$So|P
zVvqH0SNtDTcsUdzaMDpT=Ty0pDHHNL@Z0w$Y`XO
z2M-_r1S+GaH%pz#Uy0*w$Vdl=X=rQXEzO}d6J^R6zjM1u&c9vYLvLp?W7w(?np9x1
zE_0JSAJCPB%i7p*Wvg)pn5T`8k3-uR?*NT|J`eS#_#54p>!p(mLDvmc-3o0mX*mp_
zN*AeS<>#^-{S%W<*mz^!X$w_2dHWpcJ6^j64qFBft-o}o_Vx80o0>}Du;>kLts;$8
zC`7q$QI(dKYG`Wa8#wl@V4jVWBRGQ@1dr-hstpQL)Tl+aqVpGpbSfN>5i&QMXfiZ>
zaA?T1VGe?rpQ@;+pkrVdd{klI&jVS@I5_iz!=UMpTsa~mBga?1r}aRBm1WS;TT*s0f0lY=JBl66Upy)-k4J}lh=P^8(SXk~0xW=T9v*B|gzIhN
z>qsO7dFd~mgxAy4V?&)=5ieYq?zi?ZEoj)&2o)RLy=@hbCRcfT5jigwtQGE{L*8<@Yd{zg;CsL5mvzfDY}P-wos_6PfprFVaeqNE%h
zKZhLtcQld;ZD+>=nqN~>GvROfueSzJD&BE*}XfU|H&(FssBqY=hPCt`d
zH?@s2>I(|;fcW&YM6#V#!kUIP8$Nkdh0A(bEVj``-AAyYgwY~jB
zT|I7Bf@%;7aL7Wf4dZ%VqF$eiaC38OV6oy3Z#TER2G+fOCd9Iaoy6aLYbPTN{XRPz
z;U!V|vBf%H!}52L2gH_+j;`bTcQRXB+y9onc^wLm5wi3-Be}U>k_u>2Eg$=k!(l@I
zcCg+flakT2Nej3i0yn+g+}%NYb?ta;R?(g5SnwsQ49U8Wng8d|{B+lyRcEDvR3+`O{zfmrmvFrL6acVP%yG98X
zo&+VBg@px@i)%o?dG(`T;n*$S5*rnyiR#=wW}}GsAcfyQpE|>a{=$Hjg=-*_K;UtD
z#z-)AXwSRY?OPefw^iI+
z)AXz#PfEjlwTes|_{sB?4(O@fg0AJ^g8gP}ex9Ucf*@_^J(s_5jJV}c)s$`Myn|Kd
z$6>}#q^n{4vN@+Os$m7KV+`}c%4)4pv@06af4-x5#wj!KKb%caK{A&Y#Rfs
z-po?Dcb1({W=6FKIUirH&(yg=*6aLCekcKwyfK^JN5{wcA3nhO(o}SK#!CINhI`-I
z1)6&n7O&ZmyFMuNwvEic#IiOAwNkR=u5it{B9n2sAJV5pNhar=j5`*N!Na;c7g!l$
z3aYBqUkqqTJ=Re-;)s!EOeij=7SQZ3Hq}ZRds%IM*PtM$wV
z@;rlc*NRK7i3y5BETSKuumEN`Xu_8GP1Ri=OKQ$@I^ko8>H6)4rjiG5{VBM>B|%`&&s^)jS|-_95&yc=GqjNo{zFkw%%HHhS~e=s
zD#sfS+-?*t|J!+ozP6KvtOl!R)@@-z24}`9{QaVLD^9VCSR2b`b!KC#o;Ki<+wXB6
zx3&O0LOWcg4&rv4QG0)4yb}7BFSEg~=IR5#ZRj8kg}dS7_V&^%#Do==#`u
zpy6{ox?jWuR(;pg+f@mT>#HGWHAJRRDDDv~@(IDw&R>9643kK#HN`!1vBJHnC+RM&yIh8{gG2q
zA%e*U3|N0XSRa~oX-3EAneep)@{h2vvd3Xvy$7og(sayr@95+e6~Xvi1tUqnIxoIH
zVWo*OwYElb#uyW{Imam6f2rGbjR!Y3`#gPqkv57dB6K^wRGxc9B(t|aYDGS=m$&S!NmCtrMMaUg(c
zc2qC=2Z`EEFMW-me5B)24AqF*bV5Dr-M5ig(l-WPS%CgaPzs6p_gnCIvTJ=Y<6!gT
zVt@AfYCzjjsMEGi=rDQHo0yc;HqoRNnNFeWZgcm?f;cp(6CNylj36DoL(?TS7eU#+
z7&mfr#y))+CJOXQKUMZ7QIdS9@#-}7y2K1{8)cCt0~-X0O!O?Qx#E4Og+;A2SjalQ
zs7r?qn0H044=sDN$SRG$arw~n=+T_DNdSrarmu)V6@|?1-ZB#hRn`uilTGPJ@fqEy
zGt(f0B+^JDP&f=r{#Y_wi#AVDf-y!RIXU^0jXsFpf>=Ji*TeqSY!H~AMbJdCGLhC)
zn7Rx+sXw6uYj;WRYrLd^5IZq@6JI1C^YkgnedZEYy<&4(z%Q$5yv#Boo{AH8n$a
zhb4Y3PWdr269&?V%uI$xMcUrMzl=;w<_nm*qr=c3Rl@i5wWB;e-`t7D&c-mcQl7x!
zZWB`UGcw=Y2=}~wzrfLx=uet<;m3~=8I~ZRuzvMQUQdr+yTV|ATf1Uuomr__nDf=X
zZ3WYJtHp_ri(}SQAPjv+Y+0=fH4krOP@S&=zZ-t1jW1o@}z;xk8
z(Nz1co&El^HK^NrhVHa-_;&88vTU>_J33=%{if;BEY*J#1n59=07jrGQ#IP>@u#3A
z;!q+E1Rj3ZJ+!4bq9F8PXJ@yMgZL;>&gYA0%_Kbi8?S=XGM~dnQZQ!yBSgcZhY96H
zrWnU;k)qy`rX&&xlDyA%(a1Hhi5CWkmg(`Gb%m(HKi-7Z!LKGRP_B8@`7&hdDy5n=
z`OIxqxiVfX@OX1p(mQu>0Ai*v_cTMiw4qRt3~NBvr9oBy0)r>w3p~V0SCm=An6@3n)>@z!|o-$HvDK
z|3D2ZMJkLE5loMKl6R^ez@Zz%S$&mbeoqH5`Bb){Ei21q&VP)hWS2tjShfFtGE+$z
zzCR$P#uktu+#!w)cX!lWN1XU%K-r=s{|j?)Akf@q#3b#{6cZCuJ~gCxuMXRmI$nGtnH+-h
z+GEi!*X=AP<|fG`1>MBdTb?28JYc=fGvAi2I<$B(rs$;eoJCyR6_bc~p!XR@O-+sD
z=eH`-ye})I5ic1eL~TDmtfJ|8`0VJ*Yr=hNCd)G1p2MMz4C3^Mj?7;!w|Ly%JqmuW
zlIEW^Ft%z?*|fpXda>Jr^1noFZEwFgVV%|*XhH@acv8rdGxeEX{M$(vG{Zw+x(ei@
zmfXb22}8-?Fi`vo-YVrTH*C?a8%M=Hv9MqVH7H^J$KsD?>!SFZ;ZsvnHr_gn=7acz
z#W?0eCdVhVMWN12VV^$>WlQ?f;P^{(&pYTops|btm6aj>_Uz+hqpGwB)vWp0Cf5y<
zft8-je~nn?W11plq}N)4A{l8I7$!ks_x$PXW-2XaRFswX_BnF{R#6YIwMhAgd5F9X
zGmwdadS6(a^fjHtXg8=l?Rc0Sm%hk6E9!5cLVloEy4eh(=FwgP`)~I^5~pBEWo+F6
zSf2ncyMurJN91#cJTy_u8Y}@%!bq1RkGC~-bV@SXRd4F{R-*V`bS+6;W5vZ(&+I<9$;-V|eNfLa5n-6%
z2(}&uGRF;p92eS*sE*oR$@pexaqr*meB)VhmIg@h{uzkk$9~qh#cHhw#>O%)b@+(|
z^IQgqzuj~Sk(J;swEM-3TrJAPCq9k^^^`q{IItKBRXYe}e0Tdr=Huf7da3$l4PdpwWDop%^}n;dD#K4s#DYA8SHZ
z&1!riV4W4R7R#C))JH1~axJ)RYnM$$lIR%6fIVA@zV{XVyx}C+a-Dt8Y9M)^KU0+H
zR4IUb2CJ{Hg>CuaXtD50jB(_Tcx=Z$^WYu2u5kubqmwp%drJ6
z?Fo40g!Qd<-l=TQxqHEOuPX0;^z7iX?Ke^a%XT<13TA^5`4Xcw6D@Ur&VT&CUe0d}
z1GjOVF1^L@>O)l@?bD~$wzgf(nxX1OGD8fEV?TdJcZc2KoUe|oP1#=$$7ee|xbY)A
zDZq+cuTpc(fFdj^=!;{k03C69lMQ(|>uhRfRu%+!k&YOi-3|1QKB
z
z?n?eq1XP>p-IM$Z^C;2L3itnbJZAip*Zo0aw2bs8@(s^~*8T9go!%dHcAz2lM;`yp
zD=7&xjFV$S&5uDaiScyD?B-i1ze`+CoRtz`Wn+Zls4&}MO{@N!ufrzjG$B79)Y2d3tBk&)TxUTw@QS0TEL_?njX|@vq?Uz(nBFK5Pq7*xj#u*R&i|?7+6#
z+|r_n#SW&LXhtheZdah{ZVoqwyT{D>MC3nkFF#N)xLi{p7J1jXlmVeb;cP5?e(=f#
zuT7fvjSbjS781v?7{)-X3*?>tq?)Yd)~|1{BDS(pqC
zC}~H#WXlkUW*H5CDOo<)#x7%RY)A;ShGhI5s*#cRDA8YgqG(HeKDx+#(ZQ?386dv!
zlXCO)w91~Vw4AmOcATuV653fa9R$fyK8ul%rG
z-wfS
zihugoZyr38Im?Zuh6@RcF~t1anQu7>#lPpb#}4cOA!EM11`%f*07RqOVkmX{p~KJ9
z^zP;K#|)$`^Rb{rnHGH{~>1(fawV0*Z#)}M`m8-?ZJV<+e}s9wE#
z)l&az?w^5{)`S(%MRzxdNqrs1n*-=jS^_jqE*5XDrA0+VE`5^*p3CuM<&dZEeCjoz
zR;uu_H9ZPZV|fQq`Cyw4nscrVwi!fE6ciMmX$!_hN7uF;jjKG)d2@aC4ropY)8etW=xJvni)8eHi`H$%#zn^WJ5NLc-rqk|u&&4Z6fD_m&JfSI1Bvb?b<*n&sfl0^t
z=HnmRl`XrFvMKB%9}>PaA`m-fK6a0(8=qPkWS5bb4=v?XcWi&hRY?O5HdulRi4?fN
zlsJ*N-0Qw+Yic@s0(2uy%F@ib;GjXt01Fmx5XbRo6+n|pP(&nodMoap^z{~q
ziEeaUT@Mxe3vJSfI6?uLND(CNr=#^W<1b}jzW58bIfyWTDle$mmS(|x-0|2UlX+9k
zQ^EX7Nw}?EzVoBfT(-LT|=9N@^hcn-_p&sqG
z&*oVs2JSU+N4ZD`FhCAWaS;>|wH2G*Id|?pa#@>tyxX`+4HyIArWDvVrX)2WAOQff
z0qyHu&-S@i^MS-+j--!pr4fPBj~_8({~e1bfcl0wI1kaoN>mJL6KUPQm5N7lB(ui1
zE-o%kq)&djzWJ}ob<-GfDlkB;F31j-VHKvQUGQ3sp`CwyGJk_i!y^sD0fqC@$9|jO
zOqN!r!8-p==F@ZVP=U$qSpY(gQ0)59P1&t@y?5rvg<}E+GB}26NYPp4f2YFQrQtot5mn3wu_qprZ=>Ig-$
zbW26Ws~IgY>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV(
z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb
zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4
z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{
zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx}
z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov
zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22
zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq
zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t<
z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k
z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp
z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{}
zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N
Xviia!U7SGha1wx#SCgwmn*{w2TRX*I
literal 0
HcmV?d00001
From 449ccf5825b122b1b4e4c4162f1964b8b4fd18c1 Mon Sep 17 00:00:00 2001
From: kongrattapong
Date: Fri, 21 Feb 2020 17:46:13 +0700
Subject: [PATCH 05/67] [IMP] purchase_deposit: black, isort
---
purchase_deposit/__init__.py | 2 +-
purchase_deposit/__manifest__.py | 30 +--
purchase_deposit/models/invoice.py | 7 +-
purchase_deposit/models/purchase.py | 13 +-
.../models/res_config_settings.py | 12 +-
.../tests/test_purchase_deposit.py | 166 +++++++-----
.../wizard/purchase_make_invoice_advance.py | 253 ++++++++++--------
7 files changed, 272 insertions(+), 211 deletions(-)
diff --git a/purchase_deposit/__init__.py b/purchase_deposit/__init__.py
index 3a8c5973678..6d58fa9deb2 100644
--- a/purchase_deposit/__init__.py
+++ b/purchase_deposit/__init__.py
@@ -2,5 +2,5 @@
# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-from . import models
+from . import models
from . import wizard
diff --git a/purchase_deposit/__manifest__.py b/purchase_deposit/__manifest__.py
index 2103cddd870..1bdf142a5a9 100644
--- a/purchase_deposit/__manifest__.py
+++ b/purchase_deposit/__manifest__.py
@@ -3,21 +3,19 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
- 'name': 'Purchase Deposit',
- 'version': '12.0.1.0.0',
- 'summary': 'Option to create deposit from purchase order',
- 'author': 'Elico Corp, Ecosoft, Odoo Community Association (OCA)',
- 'website': 'https://github.com/OCA/purchase-workflow',
- 'category': 'Purchase Management',
- 'license': 'AGPL-3',
- 'depends': [
- 'purchase',
+ "name": "Purchase Deposit",
+ "version": "12.0.1.0.0",
+ "summary": "Option to create deposit from purchase order",
+ "author": "Elico Corp, Ecosoft, Odoo Community Association (OCA)",
+ "website": "https://github.com/OCA/purchase-workflow",
+ "category": "Purchase Management",
+ "license": "AGPL-3",
+ "depends": ["purchase"],
+ "data": [
+ "wizard/purchase_make_invoice_advance_views.xml",
+ "views/res_config_settings_views.xml",
+ "views/purchase_view.xml",
],
- 'data': [
- 'wizard/purchase_make_invoice_advance_views.xml',
- 'views/res_config_settings_views.xml',
- 'views/purchase_view.xml',
- ],
- 'installable': True,
- 'auto_install': False,
+ "installable": True,
+ "auto_install": False,
}
diff --git a/purchase_deposit/models/invoice.py b/purchase_deposit/models/invoice.py
index 22da25bd8e5..ca03c384909 100644
--- a/purchase_deposit/models/invoice.py
+++ b/purchase_deposit/models/invoice.py
@@ -6,11 +6,10 @@
class AccountInvoice(models.Model):
- _inherit = 'account.invoice'
+ _inherit = "account.invoice"
def _prepare_invoice_line_from_po_line(self, line):
- res = super(AccountInvoice, self).\
- _prepare_invoice_line_from_po_line(line)
+ res = super(AccountInvoice, self)._prepare_invoice_line_from_po_line(line)
if line.is_deposit:
- res['quantity'] = -1 * line.qty_invoiced
+ res["quantity"] = -1 * line.qty_invoiced
return res
diff --git a/purchase_deposit/models/purchase.py b/purchase_deposit/models/purchase.py
index c31c4a41890..bb97f54f9f1 100644
--- a/purchase_deposit/models/purchase.py
+++ b/purchase_deposit/models/purchase.py
@@ -6,23 +6,24 @@
class PurchaseOrder(models.Model):
- _inherit = 'purchase.order'
+ _inherit = "purchase.order"
@api.multi
def copy_data(self, default=None):
if default is None:
default = {}
- default['order_line'] = \
- [(0, 0, line.copy_data()[0])
- for line in self.order_line.filtered(lambda l: not l.is_deposit)]
+ default["order_line"] = [
+ (0, 0, line.copy_data()[0])
+ for line in self.order_line.filtered(lambda l: not l.is_deposit)
+ ]
return super(PurchaseOrder, self).copy_data(default)
class PurchaseOrderLine(models.Model):
- _inherit = 'purchase.order.line'
+ _inherit = "purchase.order.line"
is_deposit = fields.Boolean(
- string='Is a deposit payment',
+ string="Is a deposit payment",
help="Deposit payments are made when creating invoices from a purhcase"
" order. They are not copied when duplicating a purchase order.",
)
diff --git a/purchase_deposit/models/res_config_settings.py b/purchase_deposit/models/res_config_settings.py
index 7628530117b..f3621cbe3b9 100644
--- a/purchase_deposit/models/res_config_settings.py
+++ b/purchase_deposit/models/res_config_settings.py
@@ -2,16 +2,16 @@
# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-from odoo import models, fields
+from odoo import fields, models
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = "res.config.settings"
default_purchase_deposit_product_id = fields.Many2one(
- comodel_name='product.product',
- string='Purchase Deposit Product',
- default_model='purchase.advance.payment.inv',
- domain=[('type', '=', 'service')],
+ comodel_name="product.product",
+ string="Purchase Deposit Product",
+ default_model="purchase.advance.payment.inv",
+ domain=[("type", "=", "service")],
help="Default product used for payment advances.",
)
diff --git a/purchase_deposit/tests/test_purchase_deposit.py b/purchase_deposit/tests/test_purchase_deposit.py
index 0f9a48afd91..16cdab3e4fe 100644
--- a/purchase_deposit/tests/test_purchase_deposit.py
+++ b/purchase_deposit/tests/test_purchase_deposit.py
@@ -3,88 +3,117 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields
-from odoo.tests.common import TransactionCase
from odoo.exceptions import UserError
-from odoo.tests.common import Form
+from odoo.tests.common import Form, TransactionCase
class TestPurchaseDeposit(TransactionCase):
-
def setUp(self):
super(TestPurchaseDeposit, self).setUp()
- self.product_model = self.env['product.product']
- self.account_model = self.env['account.account']
- self.invoice_model = self.env['account.invoice']
- self.default_model = self.env['ir.default']
+ self.product_model = self.env["product.product"]
+ self.account_model = self.env["account.account"]
+ self.invoice_model = self.env["account.invoice"]
+ self.default_model = self.env["ir.default"]
# Create Deposit Account
- self.account_deposit = self.account_model.create({
- 'name': 'Purchase Deposit',
- 'code': '11620',
- 'user_type_id': self.env.ref(
- 'account.data_account_type_current_assets').id,
- })
+ self.account_deposit = self.account_model.create(
+ {
+ "name": "Purchase Deposit",
+ "code": "11620",
+ "user_type_id": self.env.ref(
+ "account.data_account_type_current_assets"
+ ).id,
+ }
+ )
# Create products:
- p1 = self.product1 = self.product_model.create({
- 'name': 'Test Product 1',
- 'type': 'service',
- 'default_code': 'PROD1',
- 'purchase_method': 'purchase',
- })
+ p1 = self.product1 = self.product_model.create(
+ {
+ "name": "Test Product 1",
+ "type": "service",
+ "default_code": "PROD1",
+ "purchase_method": "purchase",
+ }
+ )
- self.po = self.env['purchase.order'].create({
- 'partner_id': self.ref('base.res_partner_3'),
- 'order_line': [
- (0, 0, {'product_id': p1.id,
- 'product_uom': p1.uom_id.id,
- 'name': p1.name,
- 'price_unit': 100.0,
- 'date_planned': fields.Datetime.now(),
- 'product_qty': 42.0})]})
+ self.po = self.env["purchase.order"].create(
+ {
+ "partner_id": self.ref("base.res_partner_3"),
+ "order_line": [
+ (
+ 0,
+ 0,
+ {
+ "product_id": p1.id,
+ "product_uom": p1.uom_id.id,
+ "name": p1.name,
+ "price_unit": 100.0,
+ "date_planned": fields.Datetime.now(),
+ "product_qty": 42.0,
+ },
+ )
+ ],
+ }
+ )
def test_create_deposit_invoice(self):
self.assertEqual(len(self.po.order_line), 1)
# We create invoice from expense
- ctx = {'active_id': self.po.id,
- 'active_ids': [self.po.id],
- 'active_model': 'purchase.order'}
- CreateDeposit = self.env['purchase.advance.payment.inv']
+ ctx = {
+ "active_id": self.po.id,
+ "active_ids": [self.po.id],
+ "active_model": "purchase.order",
+ }
+ CreateDeposit = self.env["purchase.advance.payment.inv"]
self.po.button_confirm()
with Form(CreateDeposit.with_context(ctx)) as f:
- f.advance_payment_method = 'percentage'
+ f.advance_payment_method = "percentage"
f.deposit_account_id = self.account_deposit
wizard = f.save()
wizard.amount = 10.0 # 10%
wizard.create_invoices()
# New Purchase Deposit is created automatically
- deposit_id = self.default_model.get('purchase.advance.payment.inv',
- 'purchase_deposit_product_id')
+ deposit_id = self.default_model.get(
+ "purchase.advance.payment.inv", "purchase_deposit_product_id"
+ )
deposit = self.product_model.browse(deposit_id)
- self.assertEqual(deposit.name, 'Purchase Deposit')
+ self.assertEqual(deposit.name, "Purchase Deposit")
# 1 Deposit Invoice is created
- self.assertRecordValues(self.po.invoice_ids.invoice_line_ids, [
- {'product_id': deposit.id,
- 'price_unit': 420.0, 'name': 'Deposit Payment', },
- ])
+ self.assertRecordValues(
+ self.po.invoice_ids.invoice_line_ids,
+ [
+ {
+ "product_id": deposit.id,
+ "price_unit": 420.0,
+ "name": "Deposit Payment",
+ }
+ ],
+ )
# On Purchase Order, there will be new deposit line create
- self.assertRecordValues(self.po.order_line, [
- {'product_id': self.product1.id,
- 'price_unit': 100.0, 'is_deposit': False},
- {'product_id': deposit.id,
- 'price_unit': 420.0, 'is_deposit': True},
- ])
+ self.assertRecordValues(
+ self.po.order_line,
+ [
+ {
+ "product_id": self.product1.id,
+ "price_unit": 100.0,
+ "is_deposit": False,
+ },
+ {"product_id": deposit.id, "price_unit": 420.0, "is_deposit": True},
+ ],
+ )
# On Purchase Order, create normal billing
res = self.po.with_context(create_bill=True).action_view_invoice()
- ctx = res.get('context')
- f = Form(self.invoice_model.with_context(ctx),
- view='account.invoice_supplier_form')
+ ctx = res.get("context")
+ f = Form(
+ self.invoice_model.with_context(ctx), view="account.invoice_supplier_form"
+ )
invoice = f.save()
- self.assertRecordValues(invoice.invoice_line_ids, [
- {'product_id': self.product1.id,
- 'price_unit': 100.0, 'quantity': 42},
- {'product_id': deposit.id,
- 'price_unit': 420.0, 'quantity': -1},
- ])
+ self.assertRecordValues(
+ invoice.invoice_line_ids,
+ [
+ {"product_id": self.product1.id, "price_unit": 100.0, "quantity": 42},
+ {"product_id": deposit.id, "price_unit": 420.0, "quantity": -1},
+ ],
+ )
def test_create_deposit_invoice_exception(self):
"""This test focus on exception cases, when create deposit invoice,
@@ -96,39 +125,42 @@ def test_create_deposit_invoice_exception(self):
"""
self.assertEqual(len(self.po.order_line), 1)
# We create invoice from expense
- ctx = {'active_id': self.po.id,
- 'active_ids': [self.po.id],
- 'active_model': 'purchase.order'}
- CreateDeposit = self.env['purchase.advance.payment.inv']
+ ctx = {
+ "active_id": self.po.id,
+ "active_ids": [self.po.id],
+ "active_model": "purchase.order",
+ }
+ CreateDeposit = self.env["purchase.advance.payment.inv"]
# 1. This action is allowed only in Purchase Order sate
with self.assertRaises(UserError):
Form(CreateDeposit.with_context(ctx)) # Initi wizard
self.po.button_confirm()
- self.assertEqual(self.po.state, 'purchase')
+ self.assertEqual(self.po.state, "purchase")
# 2. The value of the deposit must be positive
f = Form(CreateDeposit.with_context(ctx))
- f.advance_payment_method = 'fixed'
+ f.advance_payment_method = "fixed"
f.amount = 0.0
f.deposit_account_id = self.account_deposit
wizard = f.save()
with self.assertRaises(UserError):
wizard.create_invoices()
# 3. For type percentage, The percentage of the deposit must <= 100
- wizard.advance_payment_method = 'percentage'
+ wizard.advance_payment_method = "percentage"
wizard.amount = 101.0
with self.assertRaises(UserError):
wizard.create_invoices()
wizard.amount = 10
# 4. Purchase Deposit Product's purchase_method != purchase
- deposit_id = self.default_model.get('purchase.advance.payment.inv',
- 'purchase_deposit_product_id')
+ deposit_id = self.default_model.get(
+ "purchase.advance.payment.inv", "purchase_deposit_product_id"
+ )
deposit = self.product_model.browse(deposit_id)
- deposit.purchase_method = 'receive'
+ deposit.purchase_method = "receive"
wizard.purchase_deposit_product_id = deposit
with self.assertRaises(UserError):
wizard.create_invoices()
- deposit.purchase_method = 'purchase'
+ deposit.purchase_method = "purchase"
# 5. Purchase Deposit Product's type != service
- deposit.type = 'consu'
+ deposit.type = "consu"
with self.assertRaises(UserError):
wizard.create_invoices()
diff --git a/purchase_deposit/wizard/purchase_make_invoice_advance.py b/purchase_deposit/wizard/purchase_make_invoice_advance.py
index 6f922f2b751..38d399b749a 100644
--- a/purchase_deposit/wizard/purchase_make_invoice_advance.py
+++ b/purchase_deposit/wizard/purchase_make_invoice_advance.py
@@ -4,53 +4,54 @@
import time
-from odoo import api, fields, models, _
+from odoo import _, api, fields, models
from odoo.exceptions import UserError
class PurchaseAdvancePaymentInv(models.TransientModel):
- _name = 'purchase.advance.payment.inv'
- _description = 'Purchase Advance Payment Invoice'
+ _name = "purchase.advance.payment.inv"
+ _description = "Purchase Advance Payment Invoice"
advance_payment_method = fields.Selection(
- [('percentage', 'Down payment (percentage)'),
- ('fixed', 'Deposit payment (fixed amount)')],
- string='What do you want to invoice?',
- default='percentage',
+ [
+ ("percentage", "Down payment (percentage)"),
+ ("fixed", "Deposit payment (fixed amount)"),
+ ],
+ string="What do you want to invoice?",
+ default="percentage",
required=True,
)
purchase_deposit_product_id = fields.Many2one(
- comodel_name='product.product',
- string='Deposit Payment Product',
- domain=[('type', '=', 'service')],
+ comodel_name="product.product",
+ string="Deposit Payment Product",
+ domain=[("type", "=", "service")],
)
amount = fields.Float(
- string='Deposit Payment Amount',
+ string="Deposit Payment Amount",
required=True,
help="The amount to be invoiced in advance, taxes excluded.",
)
deposit_account_id = fields.Many2one(
- comodel_name='account.account',
- string='Expense Account',
- domain=[('deprecated', '=', False)],
+ comodel_name="account.account",
+ string="Expense Account",
+ domain=[("deprecated", "=", False)],
help="Account used for deposits",
)
deposit_taxes_id = fields.Many2many(
- comodel_name='account.tax',
- string='Vendor Taxes',
+ comodel_name="account.tax",
+ string="Vendor Taxes",
help="Taxes used for deposits",
)
@api.model
def view_init(self, fields):
- active_id = self._context.get('active_id')
- purchase = self.env['purchase.order'].browse(active_id)
- if purchase.state != 'purchase':
- raise UserError(
- _('This action is allowed only in Purchase Order sate'))
+ active_id = self._context.get("active_id")
+ purchase = self.env["purchase.order"].browse(active_id)
+ if purchase.state != "purchase":
+ raise UserError(_("This action is allowed only in Purchase Order sate"))
return super().view_init(fields)
- @api.onchange('purchase_deposit_product_id')
+ @api.onchange("purchase_deposit_product_id")
def _onchagne_purchase_deposit_product_id(self):
product = self.purchase_deposit_product_id
self.deposit_account_id = product.property_account_expense_id
@@ -58,135 +59,165 @@ def _onchagne_purchase_deposit_product_id(self):
@api.multi
def _create_invoice(self, order, po_line, amount):
- Invoice = self.env['account.invoice']
- ir_property_obj = self.env['ir.property']
+ Invoice = self.env["account.invoice"]
+ ir_property_obj = self.env["ir.property"]
account_id = False
product = self.purchase_deposit_product_id
if product.id:
- account_id = product.property_account_expense_id.id or \
- product.categ_id.property_account_expense_categ_id.id
+ account_id = (
+ product.property_account_expense_id.id
+ or product.categ_id.property_account_expense_categ_id.id
+ )
if not account_id:
- inc_acc = ir_property_obj.get('property_account_expense_categ_id',
- 'product.category')
- account_id = order.fiscal_position_id.map_account(inc_acc).id \
- if inc_acc else False
+ inc_acc = ir_property_obj.get(
+ "property_account_expense_categ_id", "product.category"
+ )
+ account_id = (
+ order.fiscal_position_id.map_account(inc_acc).id if inc_acc else False
+ )
if not account_id:
raise UserError(
- _('There is no purchase account defined for this product: %s.'
- '\nYou may have to install a chart of account from '
- 'Accounting app, settings menu.') % (product.name,))
+ _(
+ "There is no purchase account defined for this product: %s."
+ "\nYou may have to install a chart of account from "
+ "Accounting app, settings menu."
+ )
+ % (product.name,)
+ )
if self.amount <= 0:
- raise UserError(_('The value of the deposit must be positive.'))
- context = {'lang': order.partner_id.lang}
+ raise UserError(_("The value of the deposit must be positive."))
+ context = {"lang": order.partner_id.lang}
amount = self.amount
- if self.advance_payment_method == 'percentage': # Case percent
+ if self.advance_payment_method == "percentage": # Case percent
if self.amount > 100:
- raise UserError(
- _('The percentage of the deposit must be not over 100'))
- amount = self.amount/100 * order.amount_untaxed
- name = _('Deposit Payment')
+ raise UserError(_("The percentage of the deposit must be not over 100"))
+ amount = self.amount / 100 * order.amount_untaxed
+ name = _("Deposit Payment")
del context
taxes = product.supplier_taxes_id.filtered(
- lambda r: not order.company_id or r.company_id == order.company_id)
+ lambda r: not order.company_id or r.company_id == order.company_id
+ )
if order.fiscal_position_id and taxes:
tax_ids = order.fiscal_position_id.map_tax(taxes).ids
else:
tax_ids = taxes.ids
- invoice = Invoice.create({
- 'name': order.name,
- 'origin': order.name,
- 'type': 'in_invoice',
- 'reference': False,
- 'account_id': order.partner_id.property_account_payable_id.id,
- 'partner_id': order.partner_id.id,
- 'invoice_line_ids': [(0, 0, {
- 'name': name,
- 'origin': order.name,
- 'account_id': account_id,
- 'price_unit': amount,
- 'quantity': 1.0,
- 'uom_id': product.uom_id.id,
- 'product_id': product.id,
- 'purchase_line_id': po_line.id,
- 'invoice_line_tax_ids': [(6, 0, tax_ids)],
- 'account_analytic_id': po_line.account_analytic_id.id or False,
- })],
- 'currency_id': order.currency_id.id,
- 'payment_term_id': order.payment_term_id.id,
- 'fiscal_position_id': order.fiscal_position_id.id or
- order.partner_id.property_account_position_id.id,
- 'purchase_id': order.id,
- 'comment': order.notes,
- })
+ invoice = Invoice.create(
+ {
+ "name": order.name,
+ "origin": order.name,
+ "type": "in_invoice",
+ "reference": False,
+ "account_id": order.partner_id.property_account_payable_id.id,
+ "partner_id": order.partner_id.id,
+ "invoice_line_ids": [
+ (
+ 0,
+ 0,
+ {
+ "name": name,
+ "origin": order.name,
+ "account_id": account_id,
+ "price_unit": amount,
+ "quantity": 1.0,
+ "uom_id": product.uom_id.id,
+ "product_id": product.id,
+ "purchase_line_id": po_line.id,
+ "invoice_line_tax_ids": [(6, 0, tax_ids)],
+ "account_analytic_id": po_line.account_analytic_id.id
+ or False,
+ },
+ )
+ ],
+ "currency_id": order.currency_id.id,
+ "payment_term_id": order.payment_term_id.id,
+ "fiscal_position_id": order.fiscal_position_id.id
+ or order.partner_id.property_account_position_id.id,
+ "purchase_id": order.id,
+ "comment": order.notes,
+ }
+ )
invoice.compute_taxes()
invoice.message_post_with_view(
- 'mail.message_origin_link',
- values={'self': invoice, 'origin': order},
- subtype_id=self.env.ref('mail.mt_note').id)
+ "mail.message_origin_link",
+ values={"self": invoice, "origin": order},
+ subtype_id=self.env.ref("mail.mt_note").id,
+ )
return invoice
@api.multi
def create_invoices(self):
- Purchase = self.env['purchase.order']
- IrDefault = self.env['ir.default'].sudo()
- purchases = Purchase.browse(self._context.get('active_ids', []))
+ Purchase = self.env["purchase.order"]
+ IrDefault = self.env["ir.default"].sudo()
+ purchases = Purchase.browse(self._context.get("active_ids", []))
# Create deposit product if necessary
product = self.purchase_deposit_product_id
if not product:
vals = self._prepare_deposit_product()
- product = self.purchase_deposit_product_id = \
- self.env['product.product'].create(vals)
- IrDefault.set('purchase.advance.payment.inv',
- 'purchase_deposit_product_id', product.id)
- PurchaseLine = self.env['purchase.order.line']
+ product = self.purchase_deposit_product_id = self.env[
+ "product.product"
+ ].create(vals)
+ IrDefault.set(
+ "purchase.advance.payment.inv",
+ "purchase_deposit_product_id",
+ product.id,
+ )
+ PurchaseLine = self.env["purchase.order.line"]
for order in purchases:
amount = self.amount
- if self.advance_payment_method == 'percentage': # Case percent
- amount = self.amount/100 * order.amount_untaxed
- if product.purchase_method != 'purchase':
+ if self.advance_payment_method == "percentage": # Case percent
+ amount = self.amount / 100 * order.amount_untaxed
+ if product.purchase_method != "purchase":
raise UserError(
- _('The product used to invoice a down payment should have '
- 'an invoice policy set to "Ordered quantities". '
- 'Please update your deposit product to be able to '
- 'create a deposit invoice.'))
- if product.type != 'service':
+ _(
+ "The product used to invoice a down payment should have "
+ 'an invoice policy set to "Ordered quantities". '
+ "Please update your deposit product to be able to "
+ "create a deposit invoice."
+ )
+ )
+ if product.type != "service":
raise UserError(
- _('The product used to invoice a down payment should be '
- 'of type "Service". Please use another product or '
- 'update this product.'))
+ _(
+ "The product used to invoice a down payment should be "
+ 'of type "Service". Please use another product or '
+ "update this product."
+ )
+ )
taxes = product.supplier_taxes_id.filtered(
- lambda r: not order.company_id or
- r.company_id == order.company_id)
+ lambda r: not order.company_id or r.company_id == order.company_id
+ )
if order.fiscal_position_id and taxes:
tax_ids = order.fiscal_position_id.map_tax(taxes).ids
else:
tax_ids = taxes.ids
- context = {'lang': order.partner_id.lang}
- po_line = PurchaseLine.create({
- 'name': _('Advance: %s') % (time.strftime('%m %Y'),),
- 'price_unit': amount,
- 'product_qty': 0.0,
- 'order_id': order.id,
- 'product_uom': product.uom_id.id,
- 'product_id': product.id,
- 'taxes_id': [(6, 0, tax_ids)],
- 'date_planned': order.date_planned,
- 'is_deposit': True,
- })
+ context = {"lang": order.partner_id.lang}
+ po_line = PurchaseLine.create(
+ {
+ "name": _("Advance: %s") % (time.strftime("%m %Y"),),
+ "price_unit": amount,
+ "product_qty": 0.0,
+ "order_id": order.id,
+ "product_uom": product.uom_id.id,
+ "product_id": product.id,
+ "taxes_id": [(6, 0, tax_ids)],
+ "date_planned": order.date_planned,
+ "is_deposit": True,
+ }
+ )
del context
self._create_invoice(order, po_line, amount)
- if self._context.get('open_invoices', False):
+ if self._context.get("open_invoices", False):
return purchases.action_view_invoice()
- return {'type': 'ir.actions.act_window_close'}
+ return {"type": "ir.actions.act_window_close"}
def _prepare_deposit_product(self):
return {
- 'name': 'Purchase Deposit',
- 'type': 'service',
- 'purchase_method': 'purchase',
- 'property_account_expense_id': self.deposit_account_id.id,
- 'supplier_taxes_id': [(6, 0, self.deposit_taxes_id.ids)],
- 'company_id': False,
+ "name": "Purchase Deposit",
+ "type": "service",
+ "purchase_method": "purchase",
+ "property_account_expense_id": self.deposit_account_id.id,
+ "supplier_taxes_id": [(6, 0, self.deposit_taxes_id.ids)],
+ "company_id": False,
}
From dfe1f38bf8cc99321fb45eba367652e8b0900ea7 Mon Sep 17 00:00:00 2001
From: kongrattapong
Date: Mon, 24 Feb 2020 11:24:50 +0700
Subject: [PATCH 06/67] [MIG] purchase_deposit: Migration to 13.0
---
purchase_deposit/README.rst | 11 ++--
purchase_deposit/__init__.py | 2 +-
purchase_deposit/__manifest__.py | 4 +-
purchase_deposit/models/__init__.py | 3 +-
purchase_deposit/models/invoice.py | 15 -----
purchase_deposit/models/purchase.py | 11 +++-
.../models/res_config_settings.py | 2 +-
purchase_deposit/readme/CONTRIBUTORS.rst | 1 +
.../static/description/index.html | 7 ++-
purchase_deposit/tests/__init__.py | 2 +-
.../tests/test_purchase_deposit.py | 8 +--
purchase_deposit/views/purchase_view.xml | 15 ++---
.../views/res_config_settings_views.xml | 25 +++++---
.../wizard/purchase_make_invoice_advance.py | 30 +++++-----
.../purchase_make_invoice_advance_views.xml | 59 ++++++++++++++-----
15 files changed, 110 insertions(+), 85 deletions(-)
delete mode 100644 purchase_deposit/models/invoice.py
diff --git a/purchase_deposit/README.rst b/purchase_deposit/README.rst
index 7cea7aa39f8..097cac65188 100644
--- a/purchase_deposit/README.rst
+++ b/purchase_deposit/README.rst
@@ -14,13 +14,13 @@ Purchase Deposit
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
- :target: https://github.com/OCA/purchase-workflow/tree/12.0/purchase_deposit
+ :target: https://github.com/OCA/purchase-workflow/tree/13.0-mig-purchase_deposit/purchase_deposit
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/purchase-workflow-12-0/purchase-workflow-12-0-purchase_deposit
+ :target: https://translation.odoo-community.org/projects/purchase-workflow-13-0-mig-purchase_deposit/purchase-workflow-13-0-mig-purchase_deposit-purchase_deposit
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/142/12.0
+ :target: https://runbot.odoo-community.org/runbot/142/13.0-mig-purchase_deposit
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -51,7 +51,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -69,6 +69,7 @@ Contributors
* Dominique K.
* Kitti Upariphutthiphong
+* Rattapong Chokmasermkul
Maintainers
~~~~~~~~~~~
@@ -83,6 +84,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-This module is part of the `OCA/purchase-workflow `_ project on GitHub.
+This module is part of the `OCA/purchase-workflow `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/purchase_deposit/__init__.py b/purchase_deposit/__init__.py
index 6d58fa9deb2..13fee6cc1cd 100644
--- a/purchase_deposit/__init__.py
+++ b/purchase_deposit/__init__.py
@@ -1,6 +1,6 @@
# Copyright 2019 Elico Corp, Dominique K.
# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import models
from . import wizard
diff --git a/purchase_deposit/__manifest__.py b/purchase_deposit/__manifest__.py
index 1bdf142a5a9..de758403d24 100644
--- a/purchase_deposit/__manifest__.py
+++ b/purchase_deposit/__manifest__.py
@@ -1,10 +1,10 @@
# Copyright 2019 Elico Corp, Dominique K.
# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Purchase Deposit",
- "version": "12.0.1.0.0",
+ "version": "13.0.1.0.0",
"summary": "Option to create deposit from purchase order",
"author": "Elico Corp, Ecosoft, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
diff --git a/purchase_deposit/models/__init__.py b/purchase_deposit/models/__init__.py
index 4cfb36fd4df..ca2212d0f27 100644
--- a/purchase_deposit/models/__init__.py
+++ b/purchase_deposit/models/__init__.py
@@ -1,7 +1,6 @@
# Copyright 2019 Elico Corp, Dominique K.
# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import res_config_settings
from . import purchase
-from . import invoice
diff --git a/purchase_deposit/models/invoice.py b/purchase_deposit/models/invoice.py
deleted file mode 100644
index ca03c384909..00000000000
--- a/purchase_deposit/models/invoice.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2019 Elico Corp, Dominique K.
-# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-
-from odoo import models
-
-
-class AccountInvoice(models.Model):
- _inherit = "account.invoice"
-
- def _prepare_invoice_line_from_po_line(self, line):
- res = super(AccountInvoice, self)._prepare_invoice_line_from_po_line(line)
- if line.is_deposit:
- res["quantity"] = -1 * line.qty_invoiced
- return res
diff --git a/purchase_deposit/models/purchase.py b/purchase_deposit/models/purchase.py
index bb97f54f9f1..0bbb3bb516d 100644
--- a/purchase_deposit/models/purchase.py
+++ b/purchase_deposit/models/purchase.py
@@ -1,14 +1,13 @@
# Copyright 2019 Elico Corp, Dominique K.
# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
-from odoo import api, fields, models
+from odoo import fields, models
class PurchaseOrder(models.Model):
_inherit = "purchase.order"
- @api.multi
def copy_data(self, default=None):
if default is None:
default = {}
@@ -27,3 +26,9 @@ class PurchaseOrderLine(models.Model):
help="Deposit payments are made when creating invoices from a purhcase"
" order. They are not copied when duplicating a purchase order.",
)
+
+ def _prepare_account_move_line(self, move):
+ res = super(PurchaseOrderLine, self)._prepare_account_move_line(move)
+ if self.is_deposit:
+ res["quantity"] = -1 * self.qty_invoiced
+ return res
diff --git a/purchase_deposit/models/res_config_settings.py b/purchase_deposit/models/res_config_settings.py
index f3621cbe3b9..291e8bbbb5b 100644
--- a/purchase_deposit/models/res_config_settings.py
+++ b/purchase_deposit/models/res_config_settings.py
@@ -1,6 +1,6 @@
# Copyright 2019 Elico Corp, Dominique K.
# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
diff --git a/purchase_deposit/readme/CONTRIBUTORS.rst b/purchase_deposit/readme/CONTRIBUTORS.rst
index 5673dd01dc8..135fb3bfd99 100644
--- a/purchase_deposit/readme/CONTRIBUTORS.rst
+++ b/purchase_deposit/readme/CONTRIBUTORS.rst
@@ -1,2 +1,3 @@
* Dominique K.
* Kitti Upariphutthiphong
+* Rattapong Chokmasermkul
diff --git a/purchase_deposit/static/description/index.html b/purchase_deposit/static/description/index.html
index 335a9fbd651..3e1d87c3ea7 100644
--- a/purchase_deposit/static/description/index.html
+++ b/purchase_deposit/static/description/index.html
@@ -367,7 +367,7 @@ Purchase Deposit
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module allow purchase order to register deposit similar to that in sales order
Table of contents
@@ -399,7 +399,7 @@
Bugs are tracked on GitHub Issues .
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-feedback .
+
feedback .
Do not contact contributors directly about support or help with technical issues.
@@ -425,7 +426,7 @@
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-
This module is part of the OCA/purchase-workflow project on GitHub.
+
This module is part of the OCA/purchase-workflow project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute .
diff --git a/purchase_deposit/tests/__init__.py b/purchase_deposit/tests/__init__.py
index 78727aba356..cb1c2f04722 100644
--- a/purchase_deposit/tests/__init__.py
+++ b/purchase_deposit/tests/__init__.py
@@ -1,5 +1,5 @@
# Copyright 2019 Elico Corp, Dominique K.
# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import test_purchase_deposit
diff --git a/purchase_deposit/tests/test_purchase_deposit.py b/purchase_deposit/tests/test_purchase_deposit.py
index 16cdab3e4fe..3ad025ffe09 100644
--- a/purchase_deposit/tests/test_purchase_deposit.py
+++ b/purchase_deposit/tests/test_purchase_deposit.py
@@ -1,6 +1,6 @@
# Copyright 2019 Elico Corp, Dominique K.
# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields
from odoo.exceptions import UserError
@@ -12,7 +12,7 @@ def setUp(self):
super(TestPurchaseDeposit, self).setUp()
self.product_model = self.env["product.product"]
self.account_model = self.env["account.account"]
- self.invoice_model = self.env["account.invoice"]
+ self.invoice_model = self.env["account.move"]
self.default_model = self.env["ir.default"]
# Create Deposit Account
@@ -103,9 +103,7 @@ def test_create_deposit_invoice(self):
# On Purchase Order, create normal billing
res = self.po.with_context(create_bill=True).action_view_invoice()
ctx = res.get("context")
- f = Form(
- self.invoice_model.with_context(ctx), view="account.invoice_supplier_form"
- )
+ f = Form(self.invoice_model.with_context(ctx), view="account.view_move_form")
invoice = f.save()
self.assertRecordValues(
invoice.invoice_line_ids,
diff --git a/purchase_deposit/views/purchase_view.xml b/purchase_deposit/views/purchase_view.xml
index 55f59408d94..7e2da808608 100644
--- a/purchase_deposit/views/purchase_view.xml
+++ b/purchase_deposit/views/purchase_view.xml
@@ -1,17 +1,18 @@
-
+
-
view.purchase.order.inherit
purchase.order
- form
-
+
-
+
-
diff --git a/purchase_deposit/views/res_config_settings_views.xml b/purchase_deposit/views/res_config_settings_views.xml
index 8c01561ff34..80d33749d4a 100644
--- a/purchase_deposit/views/res_config_settings_views.xml
+++ b/purchase_deposit/views/res_config_settings_views.xml
@@ -1,27 +1,34 @@
-
+
-
res.config.settings.view.form.inherit.purchase
res.config.settings
-
-
+
+
-
+
-
+
-
+
Product used for deposit payments
-
+
-
diff --git a/purchase_deposit/wizard/purchase_make_invoice_advance.py b/purchase_deposit/wizard/purchase_make_invoice_advance.py
index 38d399b749a..ff3621bb8ad 100644
--- a/purchase_deposit/wizard/purchase_make_invoice_advance.py
+++ b/purchase_deposit/wizard/purchase_make_invoice_advance.py
@@ -1,11 +1,13 @@
# Copyright 2019 Elico Corp, Dominique K.
# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\
import time
+from datetime import datetime
from odoo import _, api, fields, models
from odoo.exceptions import UserError
+from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
class PurchaseAdvancePaymentInv(models.TransientModel):
@@ -57,9 +59,8 @@ def _onchagne_purchase_deposit_product_id(self):
self.deposit_account_id = product.property_account_expense_id
self.deposit_taxes_id = product.supplier_taxes_id
- @api.multi
def _create_invoice(self, order, po_line, amount):
- Invoice = self.env["account.invoice"]
+ Invoice = self.env["account.move"]
ir_property_obj = self.env["ir.property"]
account_id = False
product = self.purchase_deposit_product_id
@@ -105,11 +106,8 @@ def _create_invoice(self, order, po_line, amount):
invoice = Invoice.create(
{
- "name": order.name,
- "origin": order.name,
+ "ref": order.name,
"type": "in_invoice",
- "reference": False,
- "account_id": order.partner_id.property_account_payable_id.id,
"partner_id": order.partner_id.id,
"invoice_line_ids": [
(
@@ -117,28 +115,27 @@ def _create_invoice(self, order, po_line, amount):
0,
{
"name": name,
- "origin": order.name,
+ "ref": order.name,
"account_id": account_id,
"price_unit": amount,
"quantity": 1.0,
- "uom_id": product.uom_id.id,
+ "product_uom_id": product.uom_id.id,
"product_id": product.id,
"purchase_line_id": po_line.id,
- "invoice_line_tax_ids": [(6, 0, tax_ids)],
- "account_analytic_id": po_line.account_analytic_id.id
+ "tax_ids": [(6, 0, tax_ids)],
+ "analytic_account_id": po_line.account_analytic_id.id
or False,
},
)
],
"currency_id": order.currency_id.id,
- "payment_term_id": order.payment_term_id.id,
+ "invoice_payment_term_id": order.payment_term_id.id,
"fiscal_position_id": order.fiscal_position_id.id
or order.partner_id.property_account_position_id.id,
"purchase_id": order.id,
- "comment": order.notes,
+ "narration": order.notes,
}
)
- invoice.compute_taxes()
invoice.message_post_with_view(
"mail.message_origin_link",
values={"self": invoice, "origin": order},
@@ -146,7 +143,6 @@ def _create_invoice(self, order, po_line, amount):
)
return invoice
- @api.multi
def create_invoices(self):
Purchase = self.env["purchase.order"]
IrDefault = self.env["ir.default"].sudo()
@@ -202,7 +198,9 @@ def create_invoices(self):
"product_uom": product.uom_id.id,
"product_id": product.id,
"taxes_id": [(6, 0, tax_ids)],
- "date_planned": order.date_planned,
+ "date_planned": datetime.today().strftime(
+ DEFAULT_SERVER_DATETIME_FORMAT
+ ),
"is_deposit": True,
}
)
diff --git a/purchase_deposit/wizard/purchase_make_invoice_advance_views.xml b/purchase_deposit/wizard/purchase_make_invoice_advance_views.xml
index 34988218708..dd50d0cdc6a 100644
--- a/purchase_deposit/wizard/purchase_make_invoice_advance_views.xml
+++ b/purchase_deposit/wizard/purchase_make_invoice_advance_views.xml
@@ -1,6 +1,5 @@
-
+
-
Invoice Orders
purchase.advance.payment.inv
@@ -10,32 +9,62 @@
Invoices will be created in draft so that you can review them before validation.
-
-
-
+
+
+
-
- %
+
+ %
-
-
+
+
-
Invoice Order
ir.actions.act_window
purchase.advance.payment.inv
- form
form
new
-
From 30fa496cd2795fd1ce28ffd340b66e76fafa9a5a Mon Sep 17 00:00:00 2001
From: oca-travis
Date: Fri, 27 Mar 2020 08:10:10 +0000
Subject: [PATCH 07/67] [UPD] Update purchase_deposit.pot
---
purchase_deposit/i18n/purchase_deposit.pot | 52 ++++++++++++----------
1 file changed, 28 insertions(+), 24 deletions(-)
diff --git a/purchase_deposit/i18n/purchase_deposit.pot b/purchase_deposit/i18n/purchase_deposit.pot
index cfbd565c449..1f9f7444616 100644
--- a/purchase_deposit/i18n/purchase_deposit.pot
+++ b/purchase_deposit/i18n/purchase_deposit.pot
@@ -1,12 +1,12 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
-# * purchase_deposit
+# * purchase_deposit
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 12.0\n"
+"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
-"Last-Translator: <>\n"
+"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -19,7 +19,7 @@ msgid "Account used for deposits"
msgstr ""
#. module: purchase_deposit
-#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:168
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "Advance: %s"
msgstr ""
@@ -60,7 +60,7 @@ msgid "Default product used for payment advances."
msgstr ""
#. module: purchase_deposit
-#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:88
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "Deposit Payment"
msgstr ""
@@ -81,13 +81,15 @@ msgid "Deposit Payments"
msgstr ""
#. module: purchase_deposit
-#: selection:purchase.advance.payment.inv,advance_payment_method:0
+#: model:ir.model.fields.selection,name:purchase_deposit.selection__purchase_advance_payment_inv__advance_payment_method__fixed
msgid "Deposit payment (fixed amount)"
msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_purchase_order_line__is_deposit
-msgid "Deposit payments are made when creating invoices from a purhcase order. They are not copied when duplicating a purchase order."
+msgid ""
+"Deposit payments are made when creating invoices from a purhcase order. They"
+" are not copied when duplicating a purchase order."
msgstr ""
#. module: purchase_deposit
@@ -96,7 +98,7 @@ msgid "Display Name"
msgstr ""
#. module: purchase_deposit
-#: selection:purchase.advance.payment.inv,advance_payment_method:0
+#: model:ir.model.fields.selection,name:purchase_deposit.selection__purchase_advance_payment_inv__advance_payment_method__percentage
msgid "Down payment (percentage)"
msgstr ""
@@ -110,11 +112,6 @@ msgstr ""
msgid "ID"
msgstr ""
-#. module: purchase_deposit
-#: model:ir.model,name:purchase_deposit.model_account_invoice
-msgid "Invoice"
-msgstr ""
-
#. module: purchase_deposit
#: model:ir.actions.act_window,name:purchase_deposit.action_view_purchase_advance_payment_inv
msgid "Invoice Order"
@@ -127,7 +124,9 @@ msgstr ""
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
-msgid "Invoices will be created in draft so that you can review them before validation."
+msgid ""
+"Invoices will be created in draft so that you can review them before "
+"validation."
msgstr ""
#. module: purchase_deposit
@@ -191,38 +190,44 @@ msgid "The amount to be invoiced in advance, taxes excluded."
msgstr ""
#. module: purchase_deposit
-#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:86
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "The percentage of the deposit must be not over 100"
msgstr ""
#. module: purchase_deposit
-#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:156
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
-msgid "The product used to invoice a down payment should be of type \"Service\". Please use another product or update this product."
+msgid ""
+"The product used to invoice a down payment should be of type \"Service\". "
+"Please use another product or update this product."
msgstr ""
#. module: purchase_deposit
-#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:150
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
-msgid "The product used to invoice a down payment should have an invoice policy set to \"Ordered quantities\". Please update your deposit product to be able to create a deposit invoice."
+msgid ""
+"The product used to invoice a down payment should have an invoice policy set"
+" to \"Ordered quantities\". Please update your deposit product to be able to"
+" create a deposit invoice."
msgstr ""
#. module: purchase_deposit
-#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:80
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "The value of the deposit must be positive."
msgstr ""
#. module: purchase_deposit
-#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:75
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
-msgid "There is no purchase account defined for this product: %s.\n"
+msgid ""
+"There is no purchase account defined for this product: %s.\n"
"You may have to install a chart of account from Accounting app, settings menu."
msgstr ""
#. module: purchase_deposit
-#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:50
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "This action is allowed only in Purchase Order sate"
msgstr ""
@@ -236,4 +241,3 @@ msgstr ""
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__advance_payment_method
msgid "What do you want to invoice?"
msgstr ""
-
From 95f611a6d285072e9a3dfbf69291733f46e0bb4d Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Fri, 27 Mar 2020 08:30:46 +0000
Subject: [PATCH 08/67] [UPD] README.rst
---
purchase_deposit/README.rst | 10 +++++-----
purchase_deposit/static/description/index.html | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/purchase_deposit/README.rst b/purchase_deposit/README.rst
index 097cac65188..4d4c1ed289e 100644
--- a/purchase_deposit/README.rst
+++ b/purchase_deposit/README.rst
@@ -14,13 +14,13 @@ Purchase Deposit
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
- :target: https://github.com/OCA/purchase-workflow/tree/13.0-mig-purchase_deposit/purchase_deposit
+ :target: https://github.com/OCA/purchase-workflow/tree/13.0/purchase_deposit
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/purchase-workflow-13-0-mig-purchase_deposit/purchase-workflow-13-0-mig-purchase_deposit-purchase_deposit
+ :target: https://translation.odoo-community.org/projects/purchase-workflow-13-0/purchase-workflow-13-0-purchase_deposit
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/142/13.0-mig-purchase_deposit
+ :target: https://runbot.odoo-community.org/runbot/142/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -51,7 +51,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -84,6 +84,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-This module is part of the `OCA/purchase-workflow `_ project on GitHub.
+This module is part of the `OCA/purchase-workflow `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/purchase_deposit/static/description/index.html b/purchase_deposit/static/description/index.html
index 3e1d87c3ea7..d93372924c6 100644
--- a/purchase_deposit/static/description/index.html
+++ b/purchase_deposit/static/description/index.html
@@ -367,7 +367,7 @@ Purchase Deposit
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module allow purchase order to register deposit similar to that in sales order
Table of contents
@@ -399,7 +399,7 @@
Bugs are tracked on GitHub Issues .
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-feedback .
+
feedback .
Do not contact contributors directly about support or help with technical issues.
@@ -426,7 +426,7 @@
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-
This module is part of the OCA/purchase-workflow project on GitHub.
+
This module is part of the OCA/purchase-workflow project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute .
From 8e389f1dc3f68dd78ef342d445eeed3e7715d4bd Mon Sep 17 00:00:00 2001
From: ps-tubtim
Date: Thu, 14 May 2020 17:23:47 +0700
Subject: [PATCH 09/67] [13.0][FIX] purchase_deposit
---
purchase_deposit/wizard/purchase_make_invoice_advance.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/purchase_deposit/wizard/purchase_make_invoice_advance.py b/purchase_deposit/wizard/purchase_make_invoice_advance.py
index ff3621bb8ad..74b73f1c1ea 100644
--- a/purchase_deposit/wizard/purchase_make_invoice_advance.py
+++ b/purchase_deposit/wizard/purchase_make_invoice_advance.py
@@ -1,6 +1,6 @@
# Copyright 2019 Elico Corp, Dominique K.
# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import time
from datetime import datetime
@@ -106,7 +106,7 @@ def _create_invoice(self, order, po_line, amount):
invoice = Invoice.create(
{
- "ref": order.name,
+ "invoice_origin": order.name,
"type": "in_invoice",
"partner_id": order.partner_id.id,
"invoice_line_ids": [
@@ -115,7 +115,6 @@ def _create_invoice(self, order, po_line, amount):
0,
{
"name": name,
- "ref": order.name,
"account_id": account_id,
"price_unit": amount,
"quantity": 1.0,
From ae577e3fe20b57ba0b4ee50f056f6bd59e9b8c46 Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Fri, 29 May 2020 08:04:43 +0000
Subject: [PATCH 10/67] purchase_deposit 13.0.1.0.1
---
purchase_deposit/__manifest__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/purchase_deposit/__manifest__.py b/purchase_deposit/__manifest__.py
index de758403d24..4e1d86d8b19 100644
--- a/purchase_deposit/__manifest__.py
+++ b/purchase_deposit/__manifest__.py
@@ -4,7 +4,7 @@
{
"name": "Purchase Deposit",
- "version": "13.0.1.0.0",
+ "version": "13.0.1.0.1",
"summary": "Option to create deposit from purchase order",
"author": "Elico Corp, Ecosoft, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
From 89c684ed17316a3585e2b81cf03aed05cac9f8f5 Mon Sep 17 00:00:00 2001
From: oca-travis
Date: Mon, 5 Oct 2020 10:12:45 +0000
Subject: [PATCH 11/67] [UPD] Update purchase_deposit.pot
---
purchase_deposit/i18n/purchase_deposit.pot | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/purchase_deposit/i18n/purchase_deposit.pot b/purchase_deposit/i18n/purchase_deposit.pot
index 1f9f7444616..764ee9a5086 100644
--- a/purchase_deposit/i18n/purchase_deposit.pot
+++ b/purchase_deposit/i18n/purchase_deposit.pot
@@ -29,11 +29,6 @@ msgstr ""
msgid "Cancel"
msgstr ""
-#. module: purchase_deposit
-#: model:ir.model,name:purchase_deposit.model_res_config_settings
-msgid "Config Settings"
-msgstr ""
-
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
msgid "Create Invoices"
@@ -149,6 +144,11 @@ msgstr ""
msgid "Last Updated on"
msgstr ""
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_res_config_settings
+msgid "Procurement purchase grouping settings"
+msgstr ""
+
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
msgid "Product used for deposit payments"
From 0c1f4a2491c7fcfabb8a7656006faef63781f247 Mon Sep 17 00:00:00 2001
From: Kitti U
Date: Tue, 18 May 2021 14:45:46 +0700
Subject: [PATCH 12/67] [14.0][MIG] purchase_deposit
---
purchase_deposit/README.rst | 89 ----
purchase_deposit/__manifest__.py | 3 +-
purchase_deposit/models/purchase.py | 4 +-
purchase_deposit/security/ir.model.access.csv | 2 +
.../static/description/index.html | 435 ------------------
.../tests/test_purchase_deposit.py | 6 +-
.../wizard/purchase_make_invoice_advance.py | 70 +--
7 files changed, 44 insertions(+), 565 deletions(-)
delete mode 100644 purchase_deposit/README.rst
create mode 100644 purchase_deposit/security/ir.model.access.csv
delete mode 100644 purchase_deposit/static/description/index.html
diff --git a/purchase_deposit/README.rst b/purchase_deposit/README.rst
deleted file mode 100644
index 4d4c1ed289e..00000000000
--- a/purchase_deposit/README.rst
+++ /dev/null
@@ -1,89 +0,0 @@
-================
-Purchase Deposit
-================
-
-.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! This file is generated by oca-gen-addon-readme !!
- !! changes will be overwritten. !!
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
- :target: https://odoo-community.org/page/development-status
- :alt: Beta
-.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
- :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
- :alt: License: AGPL-3
-.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
- :target: https://github.com/OCA/purchase-workflow/tree/13.0/purchase_deposit
- :alt: OCA/purchase-workflow
-.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/purchase-workflow-13-0/purchase-workflow-13-0-purchase_deposit
- :alt: Translate me on Weblate
-.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/142/13.0
- :alt: Try me on Runbot
-
-|badge1| |badge2| |badge3| |badge4| |badge5|
-
-This module allow purchase order to register deposit similar to that in sales order
-
-**Table of contents**
-
-.. contents::
- :local:
-
-Usage
-=====
-
-When purchase order is confirmed, a new button "Register Deposit" will appear.
-Normally, deposit will be used to create the 1st invoice (as deposit).
-
-#. On confirmed purchase order, click Register Deposit button, wizard will open
-#. 2 type of deposit invoice can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
-#. Fill in the value and click Create Invoice button.
-
-As deposit is created, when user click button "Create Bill" again in purchase order,
-the Vendor Bill will be created with deposit amount deducted.
-
-Bug Tracker
-===========
-
-Bugs are tracked on `GitHub Issues `_.
-In case of trouble, please check there if your issue has already been reported.
-If you spotted it first, help us smashing it by providing a detailed and welcomed
-`feedback `_.
-
-Do not contact contributors directly about support or help with technical issues.
-
-Credits
-=======
-
-Authors
-~~~~~~~
-
-* Elico Corp
-* Ecosoft
-
-Contributors
-~~~~~~~~~~~~
-
-* Dominique K.
-* Kitti Upariphutthiphong
-* Rattapong Chokmasermkul
-
-Maintainers
-~~~~~~~~~~~
-
-This module is maintained by the OCA.
-
-.. image:: https://odoo-community.org/logo.png
- :alt: Odoo Community Association
- :target: https://odoo-community.org
-
-OCA, or the Odoo Community Association, is a nonprofit organization whose
-mission is to support the collaborative development of Odoo features and
-promote its widespread use.
-
-This module is part of the `OCA/purchase-workflow `_ project on GitHub.
-
-You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/purchase_deposit/__manifest__.py b/purchase_deposit/__manifest__.py
index 4e1d86d8b19..8d08646e248 100644
--- a/purchase_deposit/__manifest__.py
+++ b/purchase_deposit/__manifest__.py
@@ -4,7 +4,7 @@
{
"name": "Purchase Deposit",
- "version": "13.0.1.0.1",
+ "version": "14.0.1.0.0",
"summary": "Option to create deposit from purchase order",
"author": "Elico Corp, Ecosoft, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
@@ -12,6 +12,7 @@
"license": "AGPL-3",
"depends": ["purchase"],
"data": [
+ "security/ir.model.access.csv",
"wizard/purchase_make_invoice_advance_views.xml",
"views/res_config_settings_views.xml",
"views/purchase_view.xml",
diff --git a/purchase_deposit/models/purchase.py b/purchase_deposit/models/purchase.py
index 0bbb3bb516d..8efda3388a1 100644
--- a/purchase_deposit/models/purchase.py
+++ b/purchase_deposit/models/purchase.py
@@ -27,8 +27,8 @@ class PurchaseOrderLine(models.Model):
" order. They are not copied when duplicating a purchase order.",
)
- def _prepare_account_move_line(self, move):
- res = super(PurchaseOrderLine, self)._prepare_account_move_line(move)
+ def _prepare_account_move_line(self, move=False):
+ res = super(PurchaseOrderLine, self)._prepare_account_move_line(move=move)
if self.is_deposit:
res["quantity"] = -1 * self.qty_invoiced
return res
diff --git a/purchase_deposit/security/ir.model.access.csv b/purchase_deposit/security/ir.model.access.csv
new file mode 100644
index 00000000000..1bba833496a
--- /dev/null
+++ b/purchase_deposit/security/ir.model.access.csv
@@ -0,0 +1,2 @@
+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+access_purchase_advance_payment_inv,access_purchase_advance_payment_inv,model_purchase_advance_payment_inv,base.group_user,1,1,1,1
diff --git a/purchase_deposit/static/description/index.html b/purchase_deposit/static/description/index.html
deleted file mode 100644
index d93372924c6..00000000000
--- a/purchase_deposit/static/description/index.html
+++ /dev/null
@@ -1,435 +0,0 @@
-
-
-
-
-
-
-Purchase Deposit
-
-
-
-
-
Purchase Deposit
-
-
-
-
This module allow purchase order to register deposit similar to that in sales order
-
Table of contents
-
-
-
-
When purchase order is confirmed, a new button “Register Deposit” will appear.
-Normally, deposit will be used to create the 1st invoice (as deposit).
-
-On confirmed purchase order, click Register Deposit button, wizard will open
-2 type of deposit invoice can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
-Fill in the value and click Create Invoice button.
-
-
As deposit is created, when user click button “Create Bill” again in purchase order,
-the Vendor Bill will be created with deposit amount deducted.
-
-
-
-
Bugs are tracked on GitHub Issues .
-In case of trouble, please check there if your issue has already been reported.
-If you spotted it first, help us smashing it by providing a detailed and welcomed
-feedback .
-
Do not contact contributors directly about support or help with technical issues.
-
-
-
-
-
-
-
-
This module is maintained by the OCA.
-
-
OCA, or the Odoo Community Association, is a nonprofit organization whose
-mission is to support the collaborative development of Odoo features and
-promote its widespread use.
-
This module is part of the OCA/purchase-workflow project on GitHub.
-
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute .
-
-
-
-
-
diff --git a/purchase_deposit/tests/test_purchase_deposit.py b/purchase_deposit/tests/test_purchase_deposit.py
index 3ad025ffe09..192a249f9ca 100644
--- a/purchase_deposit/tests/test_purchase_deposit.py
+++ b/purchase_deposit/tests/test_purchase_deposit.py
@@ -101,10 +101,8 @@ def test_create_deposit_invoice(self):
],
)
# On Purchase Order, create normal billing
- res = self.po.with_context(create_bill=True).action_view_invoice()
- ctx = res.get("context")
- f = Form(self.invoice_model.with_context(ctx), view="account.view_move_form")
- invoice = f.save()
+ res = self.po.with_context(create_bill=True).action_create_invoice()
+ invoice = self.invoice_model.browse(res["res_id"])
self.assertRecordValues(
invoice.invoice_line_ids,
[
diff --git a/purchase_deposit/wizard/purchase_make_invoice_advance.py b/purchase_deposit/wizard/purchase_make_invoice_advance.py
index 74b73f1c1ea..58ea4bafdef 100644
--- a/purchase_deposit/wizard/purchase_make_invoice_advance.py
+++ b/purchase_deposit/wizard/purchase_make_invoice_advance.py
@@ -59,8 +59,7 @@ def _onchagne_purchase_deposit_product_id(self):
self.deposit_account_id = product.property_account_expense_id
self.deposit_taxes_id = product.supplier_taxes_id
- def _create_invoice(self, order, po_line, amount):
- Invoice = self.env["account.move"]
+ def _prepare_deposit_val(self, order, po_line, amount):
ir_property_obj = self.env["ir.property"]
account_id = False
product = self.purchase_deposit_product_id
@@ -70,7 +69,7 @@ def _create_invoice(self, order, po_line, amount):
or product.categ_id.property_account_expense_categ_id.id
)
if not account_id:
- inc_acc = ir_property_obj.get(
+ inc_acc = ir_property_obj._get(
"property_account_expense_categ_id", "product.category"
)
account_id = (
@@ -104,37 +103,40 @@ def _create_invoice(self, order, po_line, amount):
else:
tax_ids = taxes.ids
- invoice = Invoice.create(
- {
- "invoice_origin": order.name,
- "type": "in_invoice",
- "partner_id": order.partner_id.id,
- "invoice_line_ids": [
- (
- 0,
- 0,
- {
- "name": name,
- "account_id": account_id,
- "price_unit": amount,
- "quantity": 1.0,
- "product_uom_id": product.uom_id.id,
- "product_id": product.id,
- "purchase_line_id": po_line.id,
- "tax_ids": [(6, 0, tax_ids)],
- "analytic_account_id": po_line.account_analytic_id.id
- or False,
- },
- )
- ],
- "currency_id": order.currency_id.id,
- "invoice_payment_term_id": order.payment_term_id.id,
- "fiscal_position_id": order.fiscal_position_id.id
- or order.partner_id.property_account_position_id.id,
- "purchase_id": order.id,
- "narration": order.notes,
- }
- )
+ deposit_val = {
+ "invoice_origin": order.name,
+ "move_type": "in_invoice",
+ "partner_id": order.partner_id.id,
+ "invoice_line_ids": [
+ (
+ 0,
+ 0,
+ {
+ "name": name,
+ "account_id": account_id,
+ "price_unit": amount,
+ "quantity": 1.0,
+ "product_uom_id": product.uom_id.id,
+ "product_id": product.id,
+ "purchase_line_id": po_line.id,
+ "tax_ids": [(6, 0, tax_ids)],
+ "analytic_account_id": po_line.account_analytic_id.id or False,
+ },
+ )
+ ],
+ "currency_id": order.currency_id.id,
+ "invoice_payment_term_id": order.payment_term_id.id,
+ "fiscal_position_id": order.fiscal_position_id.id
+ or order.partner_id.property_account_position_id.id,
+ "purchase_id": order.id,
+ "narration": order.notes,
+ }
+ return deposit_val
+
+ def _create_invoice(self, order, po_line, amount):
+ Invoice = self.env["account.move"]
+ deposit_val = self._prepare_deposit_val(order, po_line, amount)
+ invoice = Invoice.create(deposit_val)
invoice.message_post_with_view(
"mail.message_origin_link",
values={"self": invoice, "origin": order},
From 2a289b0ebc961eecb9689840fcd7b72e58ef81fb Mon Sep 17 00:00:00 2001
From: oca-travis
Date: Sun, 17 Oct 2021 16:49:25 +0000
Subject: [PATCH 13/67] [UPD] Update purchase_deposit.pot
---
purchase_deposit/i18n/purchase_deposit.pot | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/purchase_deposit/i18n/purchase_deposit.pot b/purchase_deposit/i18n/purchase_deposit.pot
index 764ee9a5086..f4cc94b2adb 100644
--- a/purchase_deposit/i18n/purchase_deposit.pot
+++ b/purchase_deposit/i18n/purchase_deposit.pot
@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 13.0\n"
+"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -29,6 +29,11 @@ msgstr ""
msgid "Cancel"
msgstr ""
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_res_config_settings
+msgid "Config Settings"
+msgstr ""
+
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
msgid "Create Invoices"
@@ -89,6 +94,9 @@ msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__display_name
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order__display_name
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__display_name
+#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__display_name
msgid "Display Name"
msgstr ""
@@ -104,6 +112,9 @@ msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__id
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order__id
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__id
+#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__id
msgid "ID"
msgstr ""
@@ -131,6 +142,9 @@ msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv____last_update
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order____last_update
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line____last_update
+#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings____last_update
msgid "Last Modified on"
msgstr ""
@@ -144,11 +158,6 @@ msgstr ""
msgid "Last Updated on"
msgstr ""
-#. module: purchase_deposit
-#: model:ir.model,name:purchase_deposit.model_res_config_settings
-msgid "Procurement purchase grouping settings"
-msgstr ""
-
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
msgid "Product used for deposit payments"
From 34585c30abd34003bd7b7e96f66f0c014e77e435 Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Sun, 17 Oct 2021 17:28:09 +0000
Subject: [PATCH 14/67] [UPD] README.rst
---
purchase_deposit/README.rst | 89 ++++
.../static/description/index.html | 435 ++++++++++++++++++
2 files changed, 524 insertions(+)
create mode 100644 purchase_deposit/README.rst
create mode 100644 purchase_deposit/static/description/index.html
diff --git a/purchase_deposit/README.rst b/purchase_deposit/README.rst
new file mode 100644
index 00000000000..e17d5303ecd
--- /dev/null
+++ b/purchase_deposit/README.rst
@@ -0,0 +1,89 @@
+================
+Purchase Deposit
+================
+
+.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! This file is generated by oca-gen-addon-readme !!
+ !! changes will be overwritten. !!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
+ :target: https://odoo-community.org/page/development-status
+ :alt: Beta
+.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ :alt: License: AGPL-3
+.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
+ :target: https://github.com/OCA/purchase-workflow/tree/14.0/purchase_deposit
+ :alt: OCA/purchase-workflow
+.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
+ :target: https://translation.odoo-community.org/projects/purchase-workflow-14-0/purchase-workflow-14-0-purchase_deposit
+ :alt: Translate me on Weblate
+.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
+ :target: https://runbot.odoo-community.org/runbot/142/14.0
+ :alt: Try me on Runbot
+
+|badge1| |badge2| |badge3| |badge4| |badge5|
+
+This module allow purchase order to register deposit similar to that in sales order
+
+**Table of contents**
+
+.. contents::
+ :local:
+
+Usage
+=====
+
+When purchase order is confirmed, a new button "Register Deposit" will appear.
+Normally, deposit will be used to create the 1st invoice (as deposit).
+
+#. On confirmed purchase order, click Register Deposit button, wizard will open
+#. 2 type of deposit invoice can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
+#. Fill in the value and click Create Invoice button.
+
+As deposit is created, when user click button "Create Bill" again in purchase order,
+the Vendor Bill will be created with deposit amount deducted.
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub Issues `_.
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us smashing it by providing a detailed and welcomed
+`feedback `_.
+
+Do not contact contributors directly about support or help with technical issues.
+
+Credits
+=======
+
+Authors
+~~~~~~~
+
+* Elico Corp
+* Ecosoft
+
+Contributors
+~~~~~~~~~~~~
+
+* Dominique K.
+* Kitti Upariphutthiphong
+* Rattapong Chokmasermkul
+
+Maintainers
+~~~~~~~~~~~
+
+This module is maintained by the OCA.
+
+.. image:: https://odoo-community.org/logo.png
+ :alt: Odoo Community Association
+ :target: https://odoo-community.org
+
+OCA, or the Odoo Community Association, is a nonprofit organization whose
+mission is to support the collaborative development of Odoo features and
+promote its widespread use.
+
+This module is part of the `OCA/purchase-workflow `_ project on GitHub.
+
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/purchase_deposit/static/description/index.html b/purchase_deposit/static/description/index.html
new file mode 100644
index 00000000000..b2be32de834
--- /dev/null
+++ b/purchase_deposit/static/description/index.html
@@ -0,0 +1,435 @@
+
+
+
+
+
+
+Purchase Deposit
+
+
+
+
+
Purchase Deposit
+
+
+
+
This module allow purchase order to register deposit similar to that in sales order
+
Table of contents
+
+
+
+
When purchase order is confirmed, a new button “Register Deposit” will appear.
+Normally, deposit will be used to create the 1st invoice (as deposit).
+
+On confirmed purchase order, click Register Deposit button, wizard will open
+2 type of deposit invoice can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
+Fill in the value and click Create Invoice button.
+
+
As deposit is created, when user click button “Create Bill” again in purchase order,
+the Vendor Bill will be created with deposit amount deducted.
+
+
+
+
Bugs are tracked on GitHub Issues .
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us smashing it by providing a detailed and welcomed
+feedback .
+
Do not contact contributors directly about support or help with technical issues.
+
+
+
+
+
+
+
+
This module is maintained by the OCA.
+
+
OCA, or the Odoo Community Association, is a nonprofit organization whose
+mission is to support the collaborative development of Odoo features and
+promote its widespread use.
+
This module is part of the OCA/purchase-workflow project on GitHub.
+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute .
+
+
+
+
+
From 5aaf6b52884b1d6c65fc3a5554a9e37766a04835 Mon Sep 17 00:00:00 2001
From: Khalid Hazam
Date: Wed, 29 Dec 2021 16:09:57 +0000
Subject: [PATCH 15/67] Added translation using Weblate (French)
---
purchase_deposit/i18n/fr.po | 253 ++++++++++++++++++++++++++++++++++++
1 file changed, 253 insertions(+)
create mode 100644 purchase_deposit/i18n/fr.po
diff --git a/purchase_deposit/i18n/fr.po b/purchase_deposit/i18n/fr.po
new file mode 100644
index 00000000000..1212a89ed36
--- /dev/null
+++ b/purchase_deposit/i18n/fr.po
@@ -0,0 +1,253 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * purchase_deposit
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 14.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=n > 1;\n"
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
+msgid "Account used for deposits"
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "Advance: %s"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Cancel"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_res_config_settings
+msgid "Config Settings"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Create Invoices"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Create and View Invoices"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_uid
+msgid "Created by"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_date
+msgid "Created on"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_res_config_settings__default_purchase_deposit_product_id
+msgid "Default product used for payment advances."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "Deposit Payment"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__amount
+msgid "Deposit Payment Amount"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__purchase_deposit_product_id
+msgid "Deposit Payment Product"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
+msgid "Deposit Payments"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields.selection,name:purchase_deposit.selection__purchase_advance_payment_inv__advance_payment_method__fixed
+msgid "Deposit payment (fixed amount)"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_order_line__is_deposit
+msgid ""
+"Deposit payments are made when creating invoices from a purhcase order. They"
+" are not copied when duplicating a purchase order."
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__display_name
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order__display_name
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__display_name
+#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__display_name
+msgid "Display Name"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields.selection,name:purchase_deposit.selection__purchase_advance_payment_inv__advance_payment_method__percentage
+msgid "Down payment (percentage)"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
+msgid "Expense Account"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__id
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order__id
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__id
+#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__id
+msgid "ID"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.actions.act_window,name:purchase_deposit.action_view_purchase_advance_payment_inv
+msgid "Invoice Order"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Invoice Purchases Order"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid ""
+"Invoices will be created in draft so that you can review them before "
+"validation."
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__is_deposit
+msgid "Is a deposit payment"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv____last_update
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order____last_update
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line____last_update
+#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings____last_update
+msgid "Last Modified on"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__write_uid
+msgid "Last Updated by"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__write_date
+msgid "Last Updated on"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
+msgid "Product used for deposit payments"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_purchase_advance_payment_inv
+msgid "Purchase Advance Payment Invoice"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__default_purchase_deposit_product_id
+msgid "Purchase Deposit Product"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_purchase_order
+msgid "Purchase Order"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_purchase_order_line
+msgid "Purchase Order Line"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_order_form_inherit
+msgid "Register Deposit"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_taxes_id
+msgid "Taxes used for deposits"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__amount
+msgid "The amount to be invoiced in advance, taxes excluded."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "The percentage of the deposit must be not over 100"
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid ""
+"The product used to invoice a down payment should be of type \"Service\". "
+"Please use another product or update this product."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid ""
+"The product used to invoice a down payment should have an invoice policy set"
+" to \"Ordered quantities\". Please update your deposit product to be able to"
+" create a deposit invoice."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "The value of the deposit must be positive."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid ""
+"There is no purchase account defined for this product: %s.\n"
+"You may have to install a chart of account from Accounting app, settings menu."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "This action is allowed only in Purchase Order sate"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__deposit_taxes_id
+msgid "Vendor Taxes"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__advance_payment_method
+msgid "What do you want to invoice?"
+msgstr ""
From c5c7942a46b8ebbce475a42db40fd0b67e55b00d Mon Sep 17 00:00:00 2001
From: Khalid Hazam
Date: Wed, 29 Dec 2021 16:35:53 +0000
Subject: [PATCH 16/67] Translated using Weblate (French)
Currently translated at 95.2% (40 of 42 strings)
Translation: purchase-workflow-14.0/purchase-workflow-14.0-purchase_deposit
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-14-0/purchase-workflow-14-0-purchase_deposit/fr/
---
purchase_deposit/i18n/fr.po | 89 ++++++++++++++++++++++---------------
1 file changed, 53 insertions(+), 36 deletions(-)
diff --git a/purchase_deposit/i18n/fr.po b/purchase_deposit/i18n/fr.po
index 1212a89ed36..adca160b6ca 100644
--- a/purchase_deposit/i18n/fr.po
+++ b/purchase_deposit/i18n/fr.po
@@ -6,29 +6,31 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2021-12-29 18:45+0000\n"
+"Last-Translator: Khalid Hazam \n"
"Language-Team: none\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
+"X-Generator: Weblate 4.3.2\n"
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
msgid "Account used for deposits"
-msgstr ""
+msgstr "Compte utilisé pour les acomptes"
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "Advance: %s"
-msgstr ""
+msgstr "Acompte : %s"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
msgid "Cancel"
-msgstr ""
+msgstr "Annuler"
#. module: purchase_deposit
#: model:ir.model,name:purchase_deposit.model_res_config_settings
@@ -38,53 +40,53 @@ msgstr ""
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
msgid "Create Invoices"
-msgstr ""
+msgstr "Créer les factures"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
msgid "Create and View Invoices"
-msgstr ""
+msgstr "Créer et afficher les factures"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_uid
msgid "Created by"
-msgstr ""
+msgstr "Crée par"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_date
msgid "Created on"
-msgstr ""
+msgstr "Crée le"
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_res_config_settings__default_purchase_deposit_product_id
msgid "Default product used for payment advances."
-msgstr ""
+msgstr "Article par défaut pour les acomptes."
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "Deposit Payment"
-msgstr ""
+msgstr "Acompte"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__amount
msgid "Deposit Payment Amount"
-msgstr ""
+msgstr "Montant de l'acompte"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__purchase_deposit_product_id
msgid "Deposit Payment Product"
-msgstr ""
+msgstr "Article pour l'acompte"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
msgid "Deposit Payments"
-msgstr ""
+msgstr "Acomptes"
#. module: purchase_deposit
#: model:ir.model.fields.selection,name:purchase_deposit.selection__purchase_advance_payment_inv__advance_payment_method__fixed
msgid "Deposit payment (fixed amount)"
-msgstr ""
+msgstr "Acompte (montant fixe)"
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_purchase_order_line__is_deposit
@@ -92,6 +94,8 @@ msgid ""
"Deposit payments are made when creating invoices from a purhcase order. They"
" are not copied when duplicating a purchase order."
msgstr ""
+"Les acomptes sont faits lorsqu'on crée des factures d'un bon de commande. "
+"Ils ne sont pas copiés lors de la duplication d'un bon de commande."
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__display_name
@@ -99,17 +103,17 @@ msgstr ""
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__display_name
#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__display_name
msgid "Display Name"
-msgstr ""
+msgstr "Nom affiché"
#. module: purchase_deposit
#: model:ir.model.fields.selection,name:purchase_deposit.selection__purchase_advance_payment_inv__advance_payment_method__percentage
msgid "Down payment (percentage)"
-msgstr ""
+msgstr "Acompte (pourcentage)"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
msgid "Expense Account"
-msgstr ""
+msgstr "Compte de dépense"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__id
@@ -117,17 +121,17 @@ msgstr ""
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__id
#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__id
msgid "ID"
-msgstr ""
+msgstr "ID"
#. module: purchase_deposit
#: model:ir.actions.act_window,name:purchase_deposit.action_view_purchase_advance_payment_inv
msgid "Invoice Order"
-msgstr ""
+msgstr "Facturer la commande"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
msgid "Invoice Purchases Order"
-msgstr ""
+msgstr "Facture le bon de commande"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
@@ -135,11 +139,13 @@ msgid ""
"Invoices will be created in draft so that you can review them before "
"validation."
msgstr ""
+"Les factures seront crées en état brouillon pour que vous puissiez les "
+"consulter avant les valider."
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__is_deposit
msgid "Is a deposit payment"
-msgstr ""
+msgstr "Est un acompte"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv____last_update
@@ -147,63 +153,64 @@ msgstr ""
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line____last_update
#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings____last_update
msgid "Last Modified on"
-msgstr ""
+msgstr "Dernière modification le"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__write_uid
msgid "Last Updated by"
-msgstr ""
+msgstr "Dernière modification par"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__write_date
msgid "Last Updated on"
-msgstr ""
+msgstr "Dernière mise-à-jour le"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
msgid "Product used for deposit payments"
-msgstr ""
+msgstr "Article utilisé pour l'enregistrement des acomptes"
#. module: purchase_deposit
#: model:ir.model,name:purchase_deposit.model_purchase_advance_payment_inv
+#, fuzzy
msgid "Purchase Advance Payment Invoice"
-msgstr ""
+msgstr "Facture d'acompte du bon de commande d'achat"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__default_purchase_deposit_product_id
msgid "Purchase Deposit Product"
-msgstr ""
+msgstr "Article d'acompte d'achat"
#. module: purchase_deposit
#: model:ir.model,name:purchase_deposit.model_purchase_order
msgid "Purchase Order"
-msgstr ""
+msgstr "Bon de commande"
#. module: purchase_deposit
#: model:ir.model,name:purchase_deposit.model_purchase_order_line
msgid "Purchase Order Line"
-msgstr ""
+msgstr "Ligne de bon de commande"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_order_form_inherit
msgid "Register Deposit"
-msgstr ""
+msgstr "Enregistrer un acompte"
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_taxes_id
msgid "Taxes used for deposits"
-msgstr ""
+msgstr "Taxes utilisés pour les acomptes"
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__amount
msgid "The amount to be invoiced in advance, taxes excluded."
-msgstr ""
+msgstr "Le montant pour la facture d'acompte, hors-taxes."
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "The percentage of the deposit must be not over 100"
-msgstr ""
+msgstr "Le pourcentage d'acompte ne doit pas dépasser 100"
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
@@ -212,6 +219,8 @@ msgid ""
"The product used to invoice a down payment should be of type \"Service\". "
"Please use another product or update this product."
msgstr ""
+"L'article utilisé pour l'acompte doit être de type \"Service\". merci "
+"d'utiliser un autre article ou modifier l'article existant."
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
@@ -221,12 +230,15 @@ msgid ""
" to \"Ordered quantities\". Please update your deposit product to be able to"
" create a deposit invoice."
msgstr ""
+"L'article utilisé pour l'acompte doit avoir une politique de contrôle \"Sur "
+"les quantités commandés\". merci d'utiliser un autre article ou modifier "
+"l'article existant."
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "The value of the deposit must be positive."
-msgstr ""
+msgstr "La valeur de l'acompte doit être positive."
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
@@ -235,19 +247,24 @@ msgid ""
"There is no purchase account defined for this product: %s.\n"
"You may have to install a chart of account from Accounting app, settings menu."
msgstr ""
+"Il n'y a pas de compte de dépenses pour l'article : %s\n"
+"Vous devriez peut-être installer un plan comptable depuis le module de "
+"Facturation."
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "This action is allowed only in Purchase Order sate"
msgstr ""
+"Cette action n'est permise que pour les documents à l'état \"Bon de "
+"commande\""
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__deposit_taxes_id
msgid "Vendor Taxes"
-msgstr ""
+msgstr "Taxes fournisseur"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__advance_payment_method
msgid "What do you want to invoice?"
-msgstr ""
+msgstr "Que voulez-vous facturer ?"
From 26653446c15ff6335f010177ebcaaee1e41dcd0e Mon Sep 17 00:00:00 2001
From: Joan Mateu Jordi
Date: Tue, 18 Jan 2022 12:43:01 +0100
Subject: [PATCH 17/67] [IMP][14.0] Purchase_deposit:added button
create_deposit
---
purchase_deposit/README.rst | 2 +-
purchase_deposit/models/purchase.py | 2 +-
purchase_deposit/readme/CONFIGURATION.rst | 2 +-
purchase_deposit/readme/CONTRIBUTORS.rst | 1 +
purchase_deposit/readme/USAGE.rst | 6 +++---
purchase_deposit/tests/test_purchase_deposit.py | 2 ++
purchase_deposit/wizard/purchase_make_invoice_advance.py | 7 ++++---
.../wizard/purchase_make_invoice_advance_views.xml | 6 +++---
8 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/purchase_deposit/README.rst b/purchase_deposit/README.rst
index e17d5303ecd..51fea202eea 100644
--- a/purchase_deposit/README.rst
+++ b/purchase_deposit/README.rst
@@ -23,7 +23,7 @@ Purchase Deposit
:target: https://runbot.odoo-community.org/runbot/142/14.0
:alt: Try me on Runbot
-|badge1| |badge2| |badge3| |badge4| |badge5|
+|badge1| |badge2| |badge3| |badge4| |badge5|
This module allow purchase order to register deposit similar to that in sales order
diff --git a/purchase_deposit/models/purchase.py b/purchase_deposit/models/purchase.py
index 8efda3388a1..c9cbe66fa61 100644
--- a/purchase_deposit/models/purchase.py
+++ b/purchase_deposit/models/purchase.py
@@ -23,7 +23,7 @@ class PurchaseOrderLine(models.Model):
is_deposit = fields.Boolean(
string="Is a deposit payment",
- help="Deposit payments are made when creating invoices from a purhcase"
+ help="Deposit payments are made when creating bills from a purhcase"
" order. They are not copied when duplicating a purchase order.",
)
diff --git a/purchase_deposit/readme/CONFIGURATION.rst b/purchase_deposit/readme/CONFIGURATION.rst
index ebdedd23334..362da6adc98 100644
--- a/purchase_deposit/readme/CONFIGURATION.rst
+++ b/purchase_deposit/readme/CONFIGURATION.rst
@@ -1,5 +1,5 @@
After install this module, you need to select the product "Purchase Deposit" in
-configuration window to be used as default product when create deposit invoice.
+configuration window to be used as default product when create deposit bill.
Go to Purchase > Configuration > Settings, then select product "Purchase Deposit"
diff --git a/purchase_deposit/readme/CONTRIBUTORS.rst b/purchase_deposit/readme/CONTRIBUTORS.rst
index 135fb3bfd99..6b7d264ccb2 100644
--- a/purchase_deposit/readme/CONTRIBUTORS.rst
+++ b/purchase_deposit/readme/CONTRIBUTORS.rst
@@ -1,3 +1,4 @@
* Dominique K.
* Kitti Upariphutthiphong
* Rattapong Chokmasermkul
+* Joan Mateu
diff --git a/purchase_deposit/readme/USAGE.rst b/purchase_deposit/readme/USAGE.rst
index 74ee733d7de..04a505efbc1 100644
--- a/purchase_deposit/readme/USAGE.rst
+++ b/purchase_deposit/readme/USAGE.rst
@@ -1,9 +1,9 @@
When purchase order is confirmed, a new button "Register Deposit" will appear.
-Normally, deposit will be used to create the 1st invoice (as deposit).
+Normally, deposit will be used to create the 1st bill (as deposit).
#. On confirmed purchase order, click Register Deposit button, wizard will open
-#. 2 type of deposit invoice can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
-#. Fill in the value and click Create Invoice button.
+#. 2 type of deposit bill can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
+#. Fill in the value and click Create bill or just create deposit.
As deposit is created, when user click button "Create Bill" again in purchase order,
the Vendor Bill will be created with deposit amount deducted.
diff --git a/purchase_deposit/tests/test_purchase_deposit.py b/purchase_deposit/tests/test_purchase_deposit.py
index 192a249f9ca..b048422d237 100644
--- a/purchase_deposit/tests/test_purchase_deposit.py
+++ b/purchase_deposit/tests/test_purchase_deposit.py
@@ -62,6 +62,7 @@ def test_create_deposit_invoice(self):
"active_id": self.po.id,
"active_ids": [self.po.id],
"active_model": "purchase.order",
+ "create_bills": True,
}
CreateDeposit = self.env["purchase.advance.payment.inv"]
self.po.button_confirm()
@@ -125,6 +126,7 @@ def test_create_deposit_invoice_exception(self):
"active_id": self.po.id,
"active_ids": [self.po.id],
"active_model": "purchase.order",
+ "create_bills": True,
}
CreateDeposit = self.env["purchase.advance.payment.inv"]
# 1. This action is allowed only in Purchase Order sate
diff --git a/purchase_deposit/wizard/purchase_make_invoice_advance.py b/purchase_deposit/wizard/purchase_make_invoice_advance.py
index 58ea4bafdef..3b8590dad70 100644
--- a/purchase_deposit/wizard/purchase_make_invoice_advance.py
+++ b/purchase_deposit/wizard/purchase_make_invoice_advance.py
@@ -206,9 +206,10 @@ def create_invoices(self):
}
)
del context
- self._create_invoice(order, po_line, amount)
- if self._context.get("open_invoices", False):
- return purchases.action_view_invoice()
+
+ if self._context.get("create_bills", False):
+ self._create_invoice(order, po_line, amount)
+ return purchases.action_view_invoice()
return {"type": "ir.actions.act_window_close"}
def _prepare_deposit_product(self):
diff --git a/purchase_deposit/wizard/purchase_make_invoice_advance_views.xml b/purchase_deposit/wizard/purchase_make_invoice_advance_views.xml
index dd50d0cdc6a..84e3a3eb40a 100644
--- a/purchase_deposit/wizard/purchase_make_invoice_advance_views.xml
+++ b/purchase_deposit/wizard/purchase_make_invoice_advance_views.xml
@@ -44,14 +44,14 @@
From 85a2d3c783b6c32deddbe65e6b6914ad1ecce535 Mon Sep 17 00:00:00 2001
From: oca-travis
Date: Tue, 25 Jan 2022 16:03:53 +0000
Subject: [PATCH 18/67] [UPD] Update purchase_deposit.pot
---
purchase_deposit/i18n/purchase_deposit.pot | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/purchase_deposit/i18n/purchase_deposit.pot b/purchase_deposit/i18n/purchase_deposit.pot
index f4cc94b2adb..c0658cfdc96 100644
--- a/purchase_deposit/i18n/purchase_deposit.pot
+++ b/purchase_deposit/i18n/purchase_deposit.pot
@@ -36,12 +36,12 @@ msgstr ""
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
-msgid "Create Invoices"
+msgid "Create and View bills"
msgstr ""
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
-msgid "Create and View Invoices"
+msgid "Create deposit"
msgstr ""
#. module: purchase_deposit
@@ -88,8 +88,8 @@ msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_purchase_order_line__is_deposit
msgid ""
-"Deposit payments are made when creating invoices from a purhcase order. They"
-" are not copied when duplicating a purchase order."
+"Deposit payments are made when creating bills from a purhcase order. They "
+"are not copied when duplicating a purchase order."
msgstr ""
#. module: purchase_deposit
From f09147757cf88a0d0ba82755f11e906e777264aa Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Tue, 25 Jan 2022 16:49:35 +0000
Subject: [PATCH 19/67] [UPD] README.rst
---
purchase_deposit/README.rst | 9 +++++----
purchase_deposit/static/description/index.html | 7 ++++---
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/purchase_deposit/README.rst b/purchase_deposit/README.rst
index 51fea202eea..f103d50e179 100644
--- a/purchase_deposit/README.rst
+++ b/purchase_deposit/README.rst
@@ -23,7 +23,7 @@ Purchase Deposit
:target: https://runbot.odoo-community.org/runbot/142/14.0
:alt: Try me on Runbot
-|badge1| |badge2| |badge3| |badge4| |badge5|
+|badge1| |badge2| |badge3| |badge4| |badge5|
This module allow purchase order to register deposit similar to that in sales order
@@ -36,11 +36,11 @@ Usage
=====
When purchase order is confirmed, a new button "Register Deposit" will appear.
-Normally, deposit will be used to create the 1st invoice (as deposit).
+Normally, deposit will be used to create the 1st bill (as deposit).
#. On confirmed purchase order, click Register Deposit button, wizard will open
-#. 2 type of deposit invoice can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
-#. Fill in the value and click Create Invoice button.
+#. 2 type of deposit bill can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
+#. Fill in the value and click Create bill or just create deposit.
As deposit is created, when user click button "Create Bill" again in purchase order,
the Vendor Bill will be created with deposit amount deducted.
@@ -70,6 +70,7 @@ Contributors
* Dominique K.
* Kitti Upariphutthiphong
* Rattapong Chokmasermkul
+* Joan Mateu
Maintainers
~~~~~~~~~~~
diff --git a/purchase_deposit/static/description/index.html b/purchase_deposit/static/description/index.html
index b2be32de834..0816027d12d 100644
--- a/purchase_deposit/static/description/index.html
+++ b/purchase_deposit/static/description/index.html
@@ -385,11 +385,11 @@ Purchase Deposit
When purchase order is confirmed, a new button “Register Deposit” will appear.
-Normally, deposit will be used to create the 1st invoice (as deposit).
+Normally, deposit will be used to create the 1st bill (as deposit).
On confirmed purchase order, click Register Deposit button, wizard will open
-2 type of deposit invoice can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
-Fill in the value and click Create Invoice button.
+2 type of deposit bill can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
+Fill in the value and click Create bill or just create deposit.
As deposit is created, when user click button “Create Bill” again in purchase order,
the Vendor Bill will be created with deposit amount deducted.
@@ -417,6 +417,7 @@
Dominique K. <dominique.k@elico-corp.com.sg >
Kitti Upariphutthiphong <kittiu@ecosoft.co.th >
Rattapong Chokmasermkul <rattapongc@ecosoft.co.th >
+
Joan Mateu <joan.mateu@forgeflow.com >
From af580eb18625526ecc593374bb8442e8cd2ea9bd Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Tue, 25 Jan 2022 16:49:37 +0000
Subject: [PATCH 20/67] purchase_deposit 14.0.1.1.0
---
purchase_deposit/__manifest__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/purchase_deposit/__manifest__.py b/purchase_deposit/__manifest__.py
index 8d08646e248..c5418ad19ea 100644
--- a/purchase_deposit/__manifest__.py
+++ b/purchase_deposit/__manifest__.py
@@ -4,7 +4,7 @@
{
"name": "Purchase Deposit",
- "version": "14.0.1.0.0",
+ "version": "14.0.1.1.0",
"summary": "Option to create deposit from purchase order",
"author": "Elico Corp, Ecosoft, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
From 1dd990b996a8284686b743ed58791987b76b5721 Mon Sep 17 00:00:00 2001
From: OCA Transbot
Date: Tue, 25 Jan 2022 16:50:12 +0000
Subject: [PATCH 21/67] Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Translation: purchase-workflow-14.0/purchase-workflow-14.0-purchase_deposit
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-14-0/purchase-workflow-14-0-purchase_deposit/
---
purchase_deposit/i18n/fr.po | 40 ++++++++++++++++++++++++-------------
1 file changed, 26 insertions(+), 14 deletions(-)
diff --git a/purchase_deposit/i18n/fr.po b/purchase_deposit/i18n/fr.po
index adca160b6ca..e101ae1a157 100644
--- a/purchase_deposit/i18n/fr.po
+++ b/purchase_deposit/i18n/fr.po
@@ -39,13 +39,13 @@ msgstr ""
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
-msgid "Create Invoices"
-msgstr "Créer les factures"
+msgid "Create and View bills"
+msgstr ""
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
-msgid "Create and View Invoices"
-msgstr "Créer et afficher les factures"
+msgid "Create deposit"
+msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_uid
@@ -91,11 +91,9 @@ msgstr "Acompte (montant fixe)"
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_purchase_order_line__is_deposit
msgid ""
-"Deposit payments are made when creating invoices from a purhcase order. They"
-" are not copied when duplicating a purchase order."
+"Deposit payments are made when creating bills from a purhcase order. They "
+"are not copied when duplicating a purchase order."
msgstr ""
-"Les acomptes sont faits lorsqu'on crée des factures d'un bon de commande. "
-"Ils ne sont pas copiés lors de la duplication d'un bon de commande."
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__display_name
@@ -226,9 +224,9 @@ msgstr ""
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid ""
-"The product used to invoice a down payment should have an invoice policy set"
-" to \"Ordered quantities\". Please update your deposit product to be able to"
-" create a deposit invoice."
+"The product used to invoice a down payment should have an invoice policy set "
+"to \"Ordered quantities\". Please update your deposit product to be able to "
+"create a deposit invoice."
msgstr ""
"L'article utilisé pour l'acompte doit avoir une politique de contrôle \"Sur "
"les quantités commandés\". merci d'utiliser un autre article ou modifier "
@@ -245,7 +243,8 @@ msgstr "La valeur de l'acompte doit être positive."
#, python-format
msgid ""
"There is no purchase account defined for this product: %s.\n"
-"You may have to install a chart of account from Accounting app, settings menu."
+"You may have to install a chart of account from Accounting app, settings "
+"menu."
msgstr ""
"Il n'y a pas de compte de dépenses pour l'article : %s\n"
"Vous devriez peut-être installer un plan comptable depuis le module de "
@@ -256,8 +255,8 @@ msgstr ""
#, python-format
msgid "This action is allowed only in Purchase Order sate"
msgstr ""
-"Cette action n'est permise que pour les documents à l'état \"Bon de "
-"commande\""
+"Cette action n'est permise que pour les documents à l'état \"Bon de commande"
+"\""
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__deposit_taxes_id
@@ -268,3 +267,16 @@ msgstr "Taxes fournisseur"
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__advance_payment_method
msgid "What do you want to invoice?"
msgstr "Que voulez-vous facturer ?"
+
+#~ msgid "Create Invoices"
+#~ msgstr "Créer les factures"
+
+#~ msgid "Create and View Invoices"
+#~ msgstr "Créer et afficher les factures"
+
+#~ msgid ""
+#~ "Deposit payments are made when creating invoices from a purhcase order. "
+#~ "They are not copied when duplicating a purchase order."
+#~ msgstr ""
+#~ "Les acomptes sont faits lorsqu'on crée des factures d'un bon de commande. "
+#~ "Ils ne sont pas copiés lors de la duplication d'un bon de commande."
From e904238beba1aad6134fab85df098b198a9ee52b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?H=C3=A9ctor=20Villarreal=20Ortega?=
Date: Fri, 11 Feb 2022 18:25:53 +0100
Subject: [PATCH 22/67] [MIG] purchase_deposit: Migration to 15.0
---
purchase_deposit/__manifest__.py | 2 +-
purchase_deposit/tests/test_purchase_deposit.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/purchase_deposit/__manifest__.py b/purchase_deposit/__manifest__.py
index c5418ad19ea..5cb50278910 100644
--- a/purchase_deposit/__manifest__.py
+++ b/purchase_deposit/__manifest__.py
@@ -4,7 +4,7 @@
{
"name": "Purchase Deposit",
- "version": "14.0.1.1.0",
+ "version": "15.0.1.0.0",
"summary": "Option to create deposit from purchase order",
"author": "Elico Corp, Ecosoft, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
diff --git a/purchase_deposit/tests/test_purchase_deposit.py b/purchase_deposit/tests/test_purchase_deposit.py
index b048422d237..2fc3a66d4f1 100644
--- a/purchase_deposit/tests/test_purchase_deposit.py
+++ b/purchase_deposit/tests/test_purchase_deposit.py
@@ -66,7 +66,7 @@ def test_create_deposit_invoice(self):
}
CreateDeposit = self.env["purchase.advance.payment.inv"]
self.po.button_confirm()
- with Form(CreateDeposit.with_context(ctx)) as f:
+ with Form(CreateDeposit.with_context(**ctx)) as f:
f.advance_payment_method = "percentage"
f.deposit_account_id = self.account_deposit
wizard = f.save()
@@ -131,11 +131,11 @@ def test_create_deposit_invoice_exception(self):
CreateDeposit = self.env["purchase.advance.payment.inv"]
# 1. This action is allowed only in Purchase Order sate
with self.assertRaises(UserError):
- Form(CreateDeposit.with_context(ctx)) # Initi wizard
+ Form(CreateDeposit.with_context(**ctx)) # Initi wizard
self.po.button_confirm()
self.assertEqual(self.po.state, "purchase")
# 2. The value of the deposit must be positive
- f = Form(CreateDeposit.with_context(ctx))
+ f = Form(CreateDeposit.with_context(**ctx))
f.advance_payment_method = "fixed"
f.amount = 0.0
f.deposit_account_id = self.account_deposit
From fc73b5ddcdad01f86024d754731b7bca7235a0f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?H=C3=A9ctor=20Villarreal=20Ortega?=
Date: Wed, 16 Mar 2022 10:10:30 +0100
Subject: [PATCH 23/67] [FIX] purchase_deposit: Split create deposit invoice
exception test
---
.../tests/test_purchase_deposit.py | 55 +++++++++++++++++--
1 file changed, 49 insertions(+), 6 deletions(-)
diff --git a/purchase_deposit/tests/test_purchase_deposit.py b/purchase_deposit/tests/test_purchase_deposit.py
index 2fc3a66d4f1..3072e462872 100644
--- a/purchase_deposit/tests/test_purchase_deposit.py
+++ b/purchase_deposit/tests/test_purchase_deposit.py
@@ -73,7 +73,7 @@ def test_create_deposit_invoice(self):
wizard.amount = 10.0 # 10%
wizard.create_invoices()
# New Purchase Deposit is created automatically
- deposit_id = self.default_model.get(
+ deposit_id = self.default_model.sudo().get(
"purchase.advance.payment.inv", "purchase_deposit_product_id"
)
deposit = self.product_model.browse(deposit_id)
@@ -112,13 +112,11 @@ def test_create_deposit_invoice(self):
],
)
- def test_create_deposit_invoice_exception(self):
+ def test_create_deposit_invoice_exception_1(self):
"""This test focus on exception cases, when create deposit invoice,
1. This action is allowed only in Purchase Order sate
2. The value of the deposit must be positive
3. For type percentage, The percentage of the deposit must <= 100
- 4. Purchase Deposit Product's purchase_method != purchase
- 5. Purchase Deposit Product's type != service
"""
self.assertEqual(len(self.po.order_line), 1)
# We create invoice from expense
@@ -148,8 +146,29 @@ def test_create_deposit_invoice_exception(self):
with self.assertRaises(UserError):
wizard.create_invoices()
wizard.amount = 10
+
+ def test_create_deposit_invoice_exception_2(self):
+ """This test focus on exception cases, when create deposit invoice,
+ 4. Purchase Deposit Product's purchase_method != purchase
+ """
+ self.assertEqual(len(self.po.order_line), 1)
+ # We create invoice from expense
+ ctx = {
+ "active_id": self.po.id,
+ "active_ids": [self.po.id],
+ "active_model": "purchase.order",
+ "create_bills": True,
+ }
+ CreateDeposit = self.env["purchase.advance.payment.inv"]
+ self.po.button_confirm()
+ self.assertEqual(self.po.state, "purchase")
+ f = Form(CreateDeposit.with_context(**ctx))
+ f.advance_payment_method = "percentage"
+ f.amount = 101.0
+ f.deposit_account_id = self.account_deposit
+ wizard = f.save()
# 4. Purchase Deposit Product's purchase_method != purchase
- deposit_id = self.default_model.get(
+ deposit_id = self.default_model.sudo().get(
"purchase.advance.payment.inv", "purchase_deposit_product_id"
)
deposit = self.product_model.browse(deposit_id)
@@ -157,7 +176,31 @@ def test_create_deposit_invoice_exception(self):
wizard.purchase_deposit_product_id = deposit
with self.assertRaises(UserError):
wizard.create_invoices()
- deposit.purchase_method = "purchase"
+
+ def test_create_deposit_invoice_exception_3(self):
+ """This test focus on exception cases, when create deposit invoice,
+ 5. Purchase Deposit Product's type != service
+ """
+ self.assertEqual(len(self.po.order_line), 1)
+ # We create invoice from expense
+ ctx = {
+ "active_id": self.po.id,
+ "active_ids": [self.po.id],
+ "active_model": "purchase.order",
+ "create_bills": True,
+ }
+ CreateDeposit = self.env["purchase.advance.payment.inv"]
+ self.po.button_confirm()
+ self.assertEqual(self.po.state, "purchase")
+ f = Form(CreateDeposit.with_context(**ctx))
+ f.advance_payment_method = "percentage"
+ f.amount = 101.0
+ f.deposit_account_id = self.account_deposit
+ wizard = f.save()
+ deposit_id = self.default_model.sudo().get(
+ "purchase.advance.payment.inv", "purchase_deposit_product_id"
+ )
+ deposit = self.product_model.browse(deposit_id)
# 5. Purchase Deposit Product's type != service
deposit.type = "consu"
with self.assertRaises(UserError):
From 5d50fde51729ca8f50c916ae34c844f7ce012586 Mon Sep 17 00:00:00 2001
From: oca-ci
Date: Mon, 2 May 2022 10:58:27 +0000
Subject: [PATCH 24/67] [UPD] Update purchase_deposit.pot
---
purchase_deposit/i18n/purchase_deposit.pot | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/purchase_deposit/i18n/purchase_deposit.pot b/purchase_deposit/i18n/purchase_deposit.pot
index c0658cfdc96..43b418668f2 100644
--- a/purchase_deposit/i18n/purchase_deposit.pot
+++ b/purchase_deposit/i18n/purchase_deposit.pot
@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 14.0\n"
+"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -13,6 +13,13 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid ""
+"% "
+msgstr ""
+
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
msgid "Account used for deposits"
@@ -94,9 +101,6 @@ msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__display_name
-#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order__display_name
-#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__display_name
-#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__display_name
msgid "Display Name"
msgstr ""
@@ -112,9 +116,6 @@ msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__id
-#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order__id
-#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__id
-#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__id
msgid "ID"
msgstr ""
@@ -142,9 +143,6 @@ msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv____last_update
-#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order____last_update
-#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line____last_update
-#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings____last_update
msgid "Last Modified on"
msgstr ""
From 5706e99e6187271523475675d7bb1a27e6aaa7eb Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Mon, 2 May 2022 11:01:31 +0000
Subject: [PATCH 25/67] [UPD] README.rst
---
purchase_deposit/README.rst | 10 +++++-----
purchase_deposit/static/description/index.html | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/purchase_deposit/README.rst b/purchase_deposit/README.rst
index f103d50e179..b556807af5f 100644
--- a/purchase_deposit/README.rst
+++ b/purchase_deposit/README.rst
@@ -14,13 +14,13 @@ Purchase Deposit
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
- :target: https://github.com/OCA/purchase-workflow/tree/14.0/purchase_deposit
+ :target: https://github.com/OCA/purchase-workflow/tree/15.0/purchase_deposit
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/purchase-workflow-14-0/purchase-workflow-14-0-purchase_deposit
+ :target: https://translation.odoo-community.org/projects/purchase-workflow-15-0/purchase-workflow-15-0-purchase_deposit
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/142/14.0
+ :target: https://runbot.odoo-community.org/runbot/142/15.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -51,7 +51,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -85,6 +85,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-This module is part of the `OCA/purchase-workflow `_ project on GitHub.
+This module is part of the `OCA/purchase-workflow `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/purchase_deposit/static/description/index.html b/purchase_deposit/static/description/index.html
index 0816027d12d..52f38b7a551 100644
--- a/purchase_deposit/static/description/index.html
+++ b/purchase_deposit/static/description/index.html
@@ -367,7 +367,7 @@ Purchase Deposit
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module allow purchase order to register deposit similar to that in sales order
Table of contents
@@ -399,7 +399,7 @@
Bugs are tracked on GitHub Issues .
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-feedback .
+
feedback .
Do not contact contributors directly about support or help with technical issues.
@@ -427,7 +427,7 @@
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-
This module is part of the OCA/purchase-workflow project on GitHub.
+
This module is part of the OCA/purchase-workflow project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute .
From b71899e8380d13a7c15ca61c7be932690bf19507 Mon Sep 17 00:00:00 2001
From: oca-ci
Date: Sun, 17 Jul 2022 09:40:48 +0000
Subject: [PATCH 26/67] [UPD] Update purchase_deposit.pot
---
purchase_deposit/i18n/purchase_deposit.pot | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/purchase_deposit/i18n/purchase_deposit.pot b/purchase_deposit/i18n/purchase_deposit.pot
index 43b418668f2..62504cfc8b4 100644
--- a/purchase_deposit/i18n/purchase_deposit.pot
+++ b/purchase_deposit/i18n/purchase_deposit.pot
@@ -36,11 +36,6 @@ msgstr ""
msgid "Cancel"
msgstr ""
-#. module: purchase_deposit
-#: model:ir.model,name:purchase_deposit.model_res_config_settings
-msgid "Config Settings"
-msgstr ""
-
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
msgid "Create and View bills"
@@ -156,6 +151,11 @@ msgstr ""
msgid "Last Updated on"
msgstr ""
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_res_config_settings
+msgid "Procurement purchase grouping settings"
+msgstr ""
+
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
msgid "Product used for deposit payments"
From 2e6c26e5dd8bb08be839d8825483d95846c0bb92 Mon Sep 17 00:00:00 2001
From: OCA Transbot
Date: Sun, 17 Jul 2022 09:44:10 +0000
Subject: [PATCH 27/67] Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Translation: purchase-workflow-15.0/purchase-workflow-15.0-purchase_deposit
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-15-0/purchase-workflow-15-0-purchase_deposit/
---
purchase_deposit/i18n/fr.po | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/purchase_deposit/i18n/fr.po b/purchase_deposit/i18n/fr.po
index e101ae1a157..5198fa39d23 100644
--- a/purchase_deposit/i18n/fr.po
+++ b/purchase_deposit/i18n/fr.po
@@ -16,6 +16,13 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.3.2\n"
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid ""
+"% "
+msgstr ""
+
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
msgid "Account used for deposits"
@@ -32,11 +39,6 @@ msgstr "Acompte : %s"
msgid "Cancel"
msgstr "Annuler"
-#. module: purchase_deposit
-#: model:ir.model,name:purchase_deposit.model_res_config_settings
-msgid "Config Settings"
-msgstr ""
-
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
msgid "Create and View bills"
@@ -97,9 +99,6 @@ msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__display_name
-#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order__display_name
-#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__display_name
-#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__display_name
msgid "Display Name"
msgstr "Nom affiché"
@@ -115,9 +114,6 @@ msgstr "Compte de dépense"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__id
-#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order__id
-#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__id
-#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__id
msgid "ID"
msgstr "ID"
@@ -147,9 +143,6 @@ msgstr "Est un acompte"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv____last_update
-#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order____last_update
-#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line____last_update
-#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"
@@ -163,6 +156,11 @@ msgstr "Dernière modification par"
msgid "Last Updated on"
msgstr "Dernière mise-à-jour le"
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_res_config_settings
+msgid "Procurement purchase grouping settings"
+msgstr ""
+
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
msgid "Product used for deposit payments"
From 5ac27bf78b69c01607fa9b2d94e7b8427aff74b5 Mon Sep 17 00:00:00 2001
From: Jesarregui
Date: Thu, 8 Sep 2022 11:45:08 +0000
Subject: [PATCH 28/67] Added translation using Weblate (Arapaho)
---
purchase_deposit/i18n/arp.po | 251 +++++++++++++++++++++++++++++++++++
1 file changed, 251 insertions(+)
create mode 100644 purchase_deposit/i18n/arp.po
diff --git a/purchase_deposit/i18n/arp.po b/purchase_deposit/i18n/arp.po
new file mode 100644
index 00000000000..3aa0cebf64f
--- /dev/null
+++ b/purchase_deposit/i18n/arp.po
@@ -0,0 +1,251 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * purchase_deposit
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 15.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"Language: arp\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid ""
+"% "
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
+msgid "Account used for deposits"
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "Advance: %s"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Cancel"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Create and View bills"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Create deposit"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_uid
+msgid "Created by"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_date
+msgid "Created on"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_res_config_settings__default_purchase_deposit_product_id
+msgid "Default product used for payment advances."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "Deposit Payment"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__amount
+msgid "Deposit Payment Amount"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__purchase_deposit_product_id
+msgid "Deposit Payment Product"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
+msgid "Deposit Payments"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields.selection,name:purchase_deposit.selection__purchase_advance_payment_inv__advance_payment_method__fixed
+msgid "Deposit payment (fixed amount)"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_order_line__is_deposit
+msgid ""
+"Deposit payments are made when creating bills from a purhcase order. They "
+"are not copied when duplicating a purchase order."
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__display_name
+msgid "Display Name"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields.selection,name:purchase_deposit.selection__purchase_advance_payment_inv__advance_payment_method__percentage
+msgid "Down payment (percentage)"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
+msgid "Expense Account"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__id
+msgid "ID"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.actions.act_window,name:purchase_deposit.action_view_purchase_advance_payment_inv
+msgid "Invoice Order"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Invoice Purchases Order"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid ""
+"Invoices will be created in draft so that you can review them before "
+"validation."
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__is_deposit
+msgid "Is a deposit payment"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv____last_update
+msgid "Last Modified on"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__write_uid
+msgid "Last Updated by"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__write_date
+msgid "Last Updated on"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_res_config_settings
+msgid "Procurement purchase grouping settings"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
+msgid "Product used for deposit payments"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_purchase_advance_payment_inv
+msgid "Purchase Advance Payment Invoice"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__default_purchase_deposit_product_id
+msgid "Purchase Deposit Product"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_purchase_order
+msgid "Purchase Order"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_purchase_order_line
+msgid "Purchase Order Line"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_order_form_inherit
+msgid "Register Deposit"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_taxes_id
+msgid "Taxes used for deposits"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__amount
+msgid "The amount to be invoiced in advance, taxes excluded."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "The percentage of the deposit must be not over 100"
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid ""
+"The product used to invoice a down payment should be of type \"Service\". "
+"Please use another product or update this product."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid ""
+"The product used to invoice a down payment should have an invoice policy set"
+" to \"Ordered quantities\". Please update your deposit product to be able to"
+" create a deposit invoice."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "The value of the deposit must be positive."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid ""
+"There is no purchase account defined for this product: %s.\n"
+"You may have to install a chart of account from Accounting app, settings menu."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "This action is allowed only in Purchase Order sate"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__deposit_taxes_id
+msgid "Vendor Taxes"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__advance_payment_method
+msgid "What do you want to invoice?"
+msgstr ""
From f461e30581f6b2b8a34160cca5296ed43561c874 Mon Sep 17 00:00:00 2001
From: Jesarregui
Date: Thu, 8 Sep 2022 11:50:21 +0000
Subject: [PATCH 29/67] Added translation using Weblate (Spanish)
---
purchase_deposit/i18n/es.po | 251 ++++++++++++++++++++++++++++++++++++
1 file changed, 251 insertions(+)
create mode 100644 purchase_deposit/i18n/es.po
diff --git a/purchase_deposit/i18n/es.po b/purchase_deposit/i18n/es.po
new file mode 100644
index 00000000000..4c197b4e35b
--- /dev/null
+++ b/purchase_deposit/i18n/es.po
@@ -0,0 +1,251 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * purchase_deposit
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 15.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid ""
+"% "
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
+msgid "Account used for deposits"
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "Advance: %s"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Cancel"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Create and View bills"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Create deposit"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_uid
+msgid "Created by"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_date
+msgid "Created on"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_res_config_settings__default_purchase_deposit_product_id
+msgid "Default product used for payment advances."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "Deposit Payment"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__amount
+msgid "Deposit Payment Amount"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__purchase_deposit_product_id
+msgid "Deposit Payment Product"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
+msgid "Deposit Payments"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields.selection,name:purchase_deposit.selection__purchase_advance_payment_inv__advance_payment_method__fixed
+msgid "Deposit payment (fixed amount)"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_order_line__is_deposit
+msgid ""
+"Deposit payments are made when creating bills from a purhcase order. They "
+"are not copied when duplicating a purchase order."
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__display_name
+msgid "Display Name"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields.selection,name:purchase_deposit.selection__purchase_advance_payment_inv__advance_payment_method__percentage
+msgid "Down payment (percentage)"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
+msgid "Expense Account"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__id
+msgid "ID"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.actions.act_window,name:purchase_deposit.action_view_purchase_advance_payment_inv
+msgid "Invoice Order"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid "Invoice Purchases Order"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
+msgid ""
+"Invoices will be created in draft so that you can review them before "
+"validation."
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__is_deposit
+msgid "Is a deposit payment"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv____last_update
+msgid "Last Modified on"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__write_uid
+msgid "Last Updated by"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__write_date
+msgid "Last Updated on"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_res_config_settings
+msgid "Procurement purchase grouping settings"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
+msgid "Product used for deposit payments"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_purchase_advance_payment_inv
+msgid "Purchase Advance Payment Invoice"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__default_purchase_deposit_product_id
+msgid "Purchase Deposit Product"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_purchase_order
+msgid "Purchase Order"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model,name:purchase_deposit.model_purchase_order_line
+msgid "Purchase Order Line"
+msgstr ""
+
+#. module: purchase_deposit
+#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_order_form_inherit
+msgid "Register Deposit"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_taxes_id
+msgid "Taxes used for deposits"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__amount
+msgid "The amount to be invoiced in advance, taxes excluded."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "The percentage of the deposit must be not over 100"
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid ""
+"The product used to invoice a down payment should be of type \"Service\". "
+"Please use another product or update this product."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid ""
+"The product used to invoice a down payment should have an invoice policy set"
+" to \"Ordered quantities\". Please update your deposit product to be able to"
+" create a deposit invoice."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "The value of the deposit must be positive."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid ""
+"There is no purchase account defined for this product: %s.\n"
+"You may have to install a chart of account from Accounting app, settings menu."
+msgstr ""
+
+#. module: purchase_deposit
+#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
+#, python-format
+msgid "This action is allowed only in Purchase Order sate"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__deposit_taxes_id
+msgid "Vendor Taxes"
+msgstr ""
+
+#. module: purchase_deposit
+#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__advance_payment_method
+msgid "What do you want to invoice?"
+msgstr ""
From fc1c3547051692d0df87a2cbfda5f08c297c0b03 Mon Sep 17 00:00:00 2001
From: Jesarregui
Date: Thu, 8 Sep 2022 14:38:49 +0000
Subject: [PATCH 30/67] Translated using Weblate (Spanish)
Currently translated at 60.4% (26 of 43 strings)
Translation: purchase-workflow-15.0/purchase-workflow-15.0-purchase_deposit
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-15-0/purchase-workflow-15-0-purchase_deposit/es/
---
purchase_deposit/i18n/es.po | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/purchase_deposit/i18n/es.po b/purchase_deposit/i18n/es.po
index 4c197b4e35b..1d02c456143 100644
--- a/purchase_deposit/i18n/es.po
+++ b/purchase_deposit/i18n/es.po
@@ -6,13 +6,15 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2022-09-08 14:39+0000\n"
+"Last-Translator: Jesarregui \n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.3.2\n"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
@@ -45,7 +47,7 @@ msgstr ""
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
msgid "Create deposit"
-msgstr ""
+msgstr "Crear anticipo"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_uid
@@ -60,33 +62,33 @@ msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_res_config_settings__default_purchase_deposit_product_id
msgid "Default product used for payment advances."
-msgstr ""
+msgstr "Producto usado para pagos adelantados."
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "Deposit Payment"
-msgstr ""
+msgstr "Anticipo"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__amount
msgid "Deposit Payment Amount"
-msgstr ""
+msgstr "Cantidad del anticipo"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__purchase_deposit_product_id
msgid "Deposit Payment Product"
-msgstr ""
+msgstr "Producto de anticipo"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
msgid "Deposit Payments"
-msgstr ""
+msgstr "Anticipo"
#. module: purchase_deposit
#: model:ir.model.fields.selection,name:purchase_deposit.selection__purchase_advance_payment_inv__advance_payment_method__fixed
msgid "Deposit payment (fixed amount)"
-msgstr ""
+msgstr "Anticipo (cantidad fija)"
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_purchase_order_line__is_deposit
@@ -94,6 +96,8 @@ msgid ""
"Deposit payments are made when creating bills from a purhcase order. They "
"are not copied when duplicating a purchase order."
msgstr ""
+"Los anticipos se realizan al crear una factura a partir de un pedido de "
+"compra. No se copian al duplicar una orden de compra."
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__display_name
@@ -103,27 +107,27 @@ msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields.selection,name:purchase_deposit.selection__purchase_advance_payment_inv__advance_payment_method__percentage
msgid "Down payment (percentage)"
-msgstr ""
+msgstr "Anticipo (porcentaje)"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
msgid "Expense Account"
-msgstr ""
+msgstr "Cuenta de coste"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__id
msgid "ID"
-msgstr ""
+msgstr "Identificación"
#. module: purchase_deposit
#: model:ir.actions.act_window,name:purchase_deposit.action_view_purchase_advance_payment_inv
msgid "Invoice Order"
-msgstr ""
+msgstr "Factura"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
msgid "Invoice Purchases Order"
-msgstr ""
+msgstr "Factura de compra"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
@@ -131,11 +135,13 @@ msgid ""
"Invoices will be created in draft so that you can review them before "
"validation."
msgstr ""
+"Las facturas se crearán en borrador para que puedas revisarlas antes de su "
+"validación."
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_order_line__is_deposit
msgid "Is a deposit payment"
-msgstr ""
+msgstr "Es un anticipo"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv____last_update
From e2e87bb2fb58ec9c243b131739bd0f994c8a2064 Mon Sep 17 00:00:00 2001
From: Harald Panten
Date: Thu, 8 Sep 2022 14:30:11 +0000
Subject: [PATCH 31/67] Translated using Weblate (Spanish)
Currently translated at 60.4% (26 of 43 strings)
Translation: purchase-workflow-15.0/purchase-workflow-15.0-purchase_deposit
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-15-0/purchase-workflow-15-0-purchase_deposit/es/
---
purchase_deposit/i18n/es.po | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/purchase_deposit/i18n/es.po b/purchase_deposit/i18n/es.po
index 1d02c456143..49d07360a4d 100644
--- a/purchase_deposit/i18n/es.po
+++ b/purchase_deposit/i18n/es.po
@@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-09-08 14:39+0000\n"
-"Last-Translator: Jesarregui \n"
+"Last-Translator: Harald Panten \n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
@@ -26,23 +26,23 @@ msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_account_id
msgid "Account used for deposits"
-msgstr ""
+msgstr "Cuenta contable para el anticipo"
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "Advance: %s"
-msgstr ""
+msgstr "Anticipo:%s"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
msgid "Cancel"
-msgstr ""
+msgstr "Cancelar"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
msgid "Create and View bills"
-msgstr ""
+msgstr "Crear y ver facturas"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_advance_payment_inv
@@ -52,12 +52,12 @@ msgstr "Crear anticipo"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_uid
msgid "Created by"
-msgstr ""
+msgstr "Creado por"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__create_date
msgid "Created on"
-msgstr ""
+msgstr "Creado en"
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_res_config_settings__default_purchase_deposit_product_id
@@ -102,7 +102,7 @@ msgstr ""
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__display_name
msgid "Display Name"
-msgstr ""
+msgstr "Nombre mostrado"
#. module: purchase_deposit
#: model:ir.model.fields.selection,name:purchase_deposit.selection__purchase_advance_payment_inv__advance_payment_method__percentage
@@ -146,17 +146,17 @@ msgstr "Es un anticipo"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv____last_update
msgid "Last Modified on"
-msgstr ""
+msgstr "Última modificación el"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__write_uid
msgid "Last Updated by"
-msgstr ""
+msgstr "Última actualización por"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__write_date
msgid "Last Updated on"
-msgstr ""
+msgstr "Última actualización el"
#. module: purchase_deposit
#: model:ir.model,name:purchase_deposit.model_res_config_settings
@@ -186,7 +186,7 @@ msgstr ""
#. module: purchase_deposit
#: model:ir.model,name:purchase_deposit.model_purchase_order_line
msgid "Purchase Order Line"
-msgstr ""
+msgstr "Línea orden de compra"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_order_form_inherit
From 913afdbee8b787a6fa4a7852ec036f5753f9fe6f Mon Sep 17 00:00:00 2001
From: Jesarregui
Date: Thu, 8 Sep 2022 14:50:22 +0000
Subject: [PATCH 32/67] Translated using Weblate (Spanish)
Currently translated at 95.3% (41 of 43 strings)
Translation: purchase-workflow-15.0/purchase-workflow-15.0-purchase_deposit
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-15-0/purchase-workflow-15-0-purchase_deposit/es/
---
purchase_deposit/i18n/es.po | 38 ++++++++++++++++++++++---------------
1 file changed, 23 insertions(+), 15 deletions(-)
diff --git a/purchase_deposit/i18n/es.po b/purchase_deposit/i18n/es.po
index 49d07360a4d..562ad7a58f7 100644
--- a/purchase_deposit/i18n/es.po
+++ b/purchase_deposit/i18n/es.po
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2022-09-08 14:39+0000\n"
-"Last-Translator: Harald Panten \n"
+"PO-Revision-Date: 2022-09-08 17:07+0000\n"
+"Last-Translator: Jesarregui \n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
@@ -166,48 +166,48 @@ msgstr ""
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.res_config_settings_view_form_purchase
msgid "Product used for deposit payments"
-msgstr ""
+msgstr "Producto usado para los anticipos"
#. module: purchase_deposit
#: model:ir.model,name:purchase_deposit.model_purchase_advance_payment_inv
msgid "Purchase Advance Payment Invoice"
-msgstr ""
+msgstr "Factura de anticipo"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_res_config_settings__default_purchase_deposit_product_id
msgid "Purchase Deposit Product"
-msgstr ""
+msgstr "Producto anticipo"
#. module: purchase_deposit
#: model:ir.model,name:purchase_deposit.model_purchase_order
msgid "Purchase Order"
-msgstr ""
+msgstr "Pedido de compra"
#. module: purchase_deposit
#: model:ir.model,name:purchase_deposit.model_purchase_order_line
msgid "Purchase Order Line"
-msgstr "Línea orden de compra"
+msgstr "Línea de pedido de compra"
#. module: purchase_deposit
#: model_terms:ir.ui.view,arch_db:purchase_deposit.view_purchase_order_form_inherit
msgid "Register Deposit"
-msgstr ""
+msgstr "Crear anticipo"
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__deposit_taxes_id
msgid "Taxes used for deposits"
-msgstr ""
+msgstr "Impuestos para los anticipos"
#. module: purchase_deposit
#: model:ir.model.fields,help:purchase_deposit.field_purchase_advance_payment_inv__amount
msgid "The amount to be invoiced in advance, taxes excluded."
-msgstr ""
+msgstr "Importe a facturar por adelantado, sin impuestos."
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "The percentage of the deposit must be not over 100"
-msgstr ""
+msgstr "El porcentaje del anticipo no puede ser superior al 100"
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
@@ -216,6 +216,8 @@ msgid ""
"The product used to invoice a down payment should be of type \"Service\". "
"Please use another product or update this product."
msgstr ""
+"El producto utilizado para facturar un anticipo debe de ser del tipo "
+"\"Servicio\". Utilice otro producto o actualice este."
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
@@ -225,12 +227,15 @@ msgid ""
" to \"Ordered quantities\". Please update your deposit product to be able to"
" create a deposit invoice."
msgstr ""
+"El producto para facturar anticipos debería de tener la política de "
+"facturación \"Sobre cantidades pedidas\". Actualice el producto anticipo o "
+"si lo prefieres crea uno nuevo."
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "The value of the deposit must be positive."
-msgstr ""
+msgstr "El importe del anticipo debe de ser positivo."
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
@@ -239,19 +244,22 @@ msgid ""
"There is no purchase account defined for this product: %s.\n"
"You may have to install a chart of account from Accounting app, settings menu."
msgstr ""
+"No hay una cuenta contable definida para este producto:%s.\n"
+"Es posible que tengas que instalar un plan contable desde la aplicación "
+"Contabilidad, en el menú de configuración."
#. module: purchase_deposit
#: code:addons/purchase_deposit/wizard/purchase_make_invoice_advance.py:0
#, python-format
msgid "This action is allowed only in Purchase Order sate"
-msgstr ""
+msgstr "Esta acción solo es posible en el estado Pedido de compra"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__deposit_taxes_id
msgid "Vendor Taxes"
-msgstr ""
+msgstr "Impuestos de proveedor"
#. module: purchase_deposit
#: model:ir.model.fields,field_description:purchase_deposit.field_purchase_advance_payment_inv__advance_payment_method
msgid "What do you want to invoice?"
-msgstr ""
+msgstr "¿Que quieres facturar?"
From c4c4f7ec8b4ca622956b2cc6db2a91df53e5dc25 Mon Sep 17 00:00:00 2001
From: newtratip
Date: Mon, 10 Jan 2022 15:56:03 +0700
Subject: [PATCH 33/67] [FIX] split function _prepare_advance_purchase_line for
hook
---
.../wizard/purchase_make_invoice_advance.py | 30 ++++++++++---------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/purchase_deposit/wizard/purchase_make_invoice_advance.py b/purchase_deposit/wizard/purchase_make_invoice_advance.py
index 3b8590dad70..248349b17d7 100644
--- a/purchase_deposit/wizard/purchase_make_invoice_advance.py
+++ b/purchase_deposit/wizard/purchase_make_invoice_advance.py
@@ -144,6 +144,19 @@ def _create_invoice(self, order, po_line, amount):
)
return invoice
+ def _prepare_advance_purchase_line(self, order, product, tax_ids, amount):
+ return {
+ "name": _("Advance: %s") % (time.strftime("%m %Y"),),
+ "price_unit": amount,
+ "product_qty": 0.0,
+ "order_id": order.id,
+ "product_uom": product.uom_id.id,
+ "product_id": product.id,
+ "taxes_id": [(6, 0, tax_ids)],
+ "date_planned": datetime.today().strftime(DEFAULT_SERVER_DATETIME_FORMAT),
+ "is_deposit": True,
+ }
+
def create_invoices(self):
Purchase = self.env["purchase.order"]
IrDefault = self.env["ir.default"].sudo()
@@ -190,21 +203,10 @@ def create_invoices(self):
else:
tax_ids = taxes.ids
context = {"lang": order.partner_id.lang}
- po_line = PurchaseLine.create(
- {
- "name": _("Advance: %s") % (time.strftime("%m %Y"),),
- "price_unit": amount,
- "product_qty": 0.0,
- "order_id": order.id,
- "product_uom": product.uom_id.id,
- "product_id": product.id,
- "taxes_id": [(6, 0, tax_ids)],
- "date_planned": datetime.today().strftime(
- DEFAULT_SERVER_DATETIME_FORMAT
- ),
- "is_deposit": True,
- }
+ adv_po_line_dict = self._prepare_advance_purchase_line(
+ order, product, tax_ids, amount
)
+ po_line = PurchaseLine.create(adv_po_line_dict)
del context
if self._context.get("create_bills", False):
From 98068ccea9e81504346531cf394d5f8cffb42429 Mon Sep 17 00:00:00 2001
From: Saran440
Date: Wed, 22 Feb 2023 16:31:51 +0700
Subject: [PATCH 34/67] [FIX] send analytic_tag in deposit_val
---
purchase_deposit/wizard/purchase_make_invoice_advance.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/purchase_deposit/wizard/purchase_make_invoice_advance.py b/purchase_deposit/wizard/purchase_make_invoice_advance.py
index 248349b17d7..dc363b977b2 100644
--- a/purchase_deposit/wizard/purchase_make_invoice_advance.py
+++ b/purchase_deposit/wizard/purchase_make_invoice_advance.py
@@ -121,6 +121,7 @@ def _prepare_deposit_val(self, order, po_line, amount):
"purchase_line_id": po_line.id,
"tax_ids": [(6, 0, tax_ids)],
"analytic_account_id": po_line.account_analytic_id.id or False,
+ "analytic_tag_ids": [(6, 0, po_line.analytic_tag_ids.ids)],
},
)
],
From 06a9b68b2f249bc63a35a04b7fe1eb44763d9cc4 Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Wed, 15 Mar 2023 09:07:10 +0000
Subject: [PATCH 35/67] purchase_deposit 15.0.1.0.1
---
purchase_deposit/__manifest__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/purchase_deposit/__manifest__.py b/purchase_deposit/__manifest__.py
index 5cb50278910..39d561c96fe 100644
--- a/purchase_deposit/__manifest__.py
+++ b/purchase_deposit/__manifest__.py
@@ -4,7 +4,7 @@
{
"name": "Purchase Deposit",
- "version": "15.0.1.0.0",
+ "version": "15.0.1.0.1",
"summary": "Option to create deposit from purchase order",
"author": "Elico Corp, Ecosoft, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
From ffed42c62a2229660372ef8caed8240254a4631e Mon Sep 17 00:00:00 2001
From: Aungkokolin1997
Date: Mon, 24 Apr 2023 17:57:54 +0630
Subject: [PATCH 36/67] [MIG] purchase_deposit: Migration to 16.0
---
purchase_deposit/README.rst | 13 +++---
purchase_deposit/__manifest__.py | 2 +-
purchase_deposit/models/__init__.py | 1 +
purchase_deposit/models/purchase.py | 4 +-
purchase_deposit/models/res_company.py | 15 +++++++
.../models/res_config_settings.py | 10 ++---
purchase_deposit/readme/CONTRIBUTORS.rst | 3 ++
.../static/description/index.html | 12 +++--
.../tests/test_purchase_deposit.py | 45 +++++++------------
.../views/res_config_settings_views.xml | 4 +-
.../wizard/purchase_make_invoice_advance.py | 29 +++++-------
11 files changed, 72 insertions(+), 66 deletions(-)
create mode 100644 purchase_deposit/models/res_company.py
diff --git a/purchase_deposit/README.rst b/purchase_deposit/README.rst
index b556807af5f..9d14e00bb2e 100644
--- a/purchase_deposit/README.rst
+++ b/purchase_deposit/README.rst
@@ -14,13 +14,13 @@ Purchase Deposit
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
- :target: https://github.com/OCA/purchase-workflow/tree/15.0/purchase_deposit
+ :target: https://github.com/OCA/purchase-workflow/tree/16.0/purchase_deposit
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/purchase-workflow-15-0/purchase-workflow-15-0-purchase_deposit
+ :target: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_deposit
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/142/15.0
+ :target: https://runbot.odoo-community.org/runbot/142/16.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -51,7 +51,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -71,6 +71,9 @@ Contributors
* Kitti Upariphutthiphong
* Rattapong Chokmasermkul
* Joan Mateu
+* `Quartile `__:
+
+ * Aung Ko Ko Lin
Maintainers
~~~~~~~~~~~
@@ -85,6 +88,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-This module is part of the `OCA/purchase-workflow `_ project on GitHub.
+This module is part of the `OCA/purchase-workflow `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/purchase_deposit/__manifest__.py b/purchase_deposit/__manifest__.py
index 39d561c96fe..d043dbb5899 100644
--- a/purchase_deposit/__manifest__.py
+++ b/purchase_deposit/__manifest__.py
@@ -4,7 +4,7 @@
{
"name": "Purchase Deposit",
- "version": "15.0.1.0.1",
+ "version": "16.0.1.0.0",
"summary": "Option to create deposit from purchase order",
"author": "Elico Corp, Ecosoft, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
diff --git a/purchase_deposit/models/__init__.py b/purchase_deposit/models/__init__.py
index ca2212d0f27..0832cfff0e0 100644
--- a/purchase_deposit/models/__init__.py
+++ b/purchase_deposit/models/__init__.py
@@ -2,5 +2,6 @@
# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+from . import res_company
from . import res_config_settings
from . import purchase
diff --git a/purchase_deposit/models/purchase.py b/purchase_deposit/models/purchase.py
index c9cbe66fa61..7aaab8bc99e 100644
--- a/purchase_deposit/models/purchase.py
+++ b/purchase_deposit/models/purchase.py
@@ -15,7 +15,7 @@ def copy_data(self, default=None):
(0, 0, line.copy_data()[0])
for line in self.order_line.filtered(lambda l: not l.is_deposit)
]
- return super(PurchaseOrder, self).copy_data(default)
+ return super().copy_data(default)
class PurchaseOrderLine(models.Model):
@@ -28,7 +28,7 @@ class PurchaseOrderLine(models.Model):
)
def _prepare_account_move_line(self, move=False):
- res = super(PurchaseOrderLine, self)._prepare_account_move_line(move=move)
+ res = super()._prepare_account_move_line(move=move)
if self.is_deposit:
res["quantity"] = -1 * self.qty_invoiced
return res
diff --git a/purchase_deposit/models/res_company.py b/purchase_deposit/models/res_company.py
new file mode 100644
index 00000000000..e1c004a3b4d
--- /dev/null
+++ b/purchase_deposit/models/res_company.py
@@ -0,0 +1,15 @@
+# Copyright 2023 Quartile Limited
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+
+from odoo import fields, models
+
+
+class ResCompany(models.Model):
+ _inherit = "res.company"
+
+ purchase_deposit_product_id = fields.Many2one(
+ comodel_name="product.product",
+ string="Purchase Deposit Product",
+ domain=[("type", "=", "service")],
+ help="Default product used for payment advances.",
+ )
diff --git a/purchase_deposit/models/res_config_settings.py b/purchase_deposit/models/res_config_settings.py
index 291e8bbbb5b..9ac312ec905 100644
--- a/purchase_deposit/models/res_config_settings.py
+++ b/purchase_deposit/models/res_config_settings.py
@@ -1,5 +1,6 @@
# Copyright 2019 Elico Corp, Dominique K.
# Copyright 2019 Ecosoft Co., Ltd., Kitti U.
+# Copyright 2023 Quartile Limited
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
@@ -8,10 +9,7 @@
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
- default_purchase_deposit_product_id = fields.Many2one(
- comodel_name="product.product",
- string="Purchase Deposit Product",
- default_model="purchase.advance.payment.inv",
- domain=[("type", "=", "service")],
- help="Default product used for payment advances.",
+ purchase_deposit_product_id = fields.Many2one(
+ related="company_id.purchase_deposit_product_id",
+ readonly=False,
)
diff --git a/purchase_deposit/readme/CONTRIBUTORS.rst b/purchase_deposit/readme/CONTRIBUTORS.rst
index 6b7d264ccb2..e415434e32d 100644
--- a/purchase_deposit/readme/CONTRIBUTORS.rst
+++ b/purchase_deposit/readme/CONTRIBUTORS.rst
@@ -2,3 +2,6 @@
* Kitti Upariphutthiphong
* Rattapong Chokmasermkul
* Joan Mateu
+* `Quartile `__:
+
+ * Aung Ko Ko Lin
diff --git a/purchase_deposit/static/description/index.html b/purchase_deposit/static/description/index.html
index 52f38b7a551..3e7f2149f09 100644
--- a/purchase_deposit/static/description/index.html
+++ b/purchase_deposit/static/description/index.html
@@ -3,7 +3,7 @@
-
+
Purchase Deposit