mirror of
https://github.com/bringout/oca-workflow-process.git
synced 2026-04-23 03:32:02 +02:00
Initial commit: OCA Workflow Process packages (456 packages)
This commit is contained in:
commit
d366e42934
18799 changed files with 1284507 additions and 0 deletions
|
|
@ -0,0 +1,8 @@
|
|||
# Copyright 2019 Elico Corp, Dominique K. <dominique.k@elico-corp.com.sg>
|
||||
# Copyright 2019 Ecosoft Co., Ltd., Kitti U. <kittiu@ecosoft.co.th>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import account_move
|
||||
from . import res_company
|
||||
from . import res_config_settings
|
||||
from . import purchase
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
# Copyright 2023 Quartile Limited (https://www.quartile.co)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = "account.move"
|
||||
|
||||
def action_post(self):
|
||||
res = super().action_post()
|
||||
for line in self.line_ids:
|
||||
if not line.purchase_line_id.is_deposit:
|
||||
continue
|
||||
line.purchase_line_id.taxes_id = line.tax_ids
|
||||
line.purchase_line_id.price_unit = line.price_unit
|
||||
return res
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
# Copyright 2019 Elico Corp, Dominique K. <dominique.k@elico-corp.com.sg>
|
||||
# Copyright 2019 Ecosoft Co., Ltd., Kitti U. <kittiu@ecosoft.co.th>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class PurchaseOrder(models.Model):
|
||||
_inherit = "purchase.order"
|
||||
|
||||
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
|
||||
if not line.is_deposit
|
||||
]
|
||||
return super().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 bills from a purchase"
|
||||
" order. They are not copied when duplicating a purchase order.",
|
||||
)
|
||||
|
||||
def _prepare_account_move_line(self, move=False):
|
||||
res = super()._prepare_account_move_line(move=move)
|
||||
if self.is_deposit:
|
||||
res["quantity"] = -1 * self.qty_invoiced
|
||||
return res
|
||||
|
|
@ -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.",
|
||||
)
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
# Copyright 2019 Elico Corp, Dominique K. <dominique.k@elico-corp.com.sg>
|
||||
# Copyright 2019 Ecosoft Co., Ltd., Kitti U. <kittiu@ecosoft.co.th>
|
||||
# Copyright 2023 Quartile Limited
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = "res.config.settings"
|
||||
|
||||
purchase_deposit_product_id = fields.Many2one(
|
||||
related="company_id.purchase_deposit_product_id",
|
||||
readonly=False,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue