mirror of
https://github.com/bringout/oca-purchase.git
synced 2026-04-23 00:42:06 +02:00
Add oca-purchase submodule with 96 purchase modules moved from oca-workflow-process
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
b0628ee8ea
commit
7378b233e9
3994 changed files with 334316 additions and 0 deletions
|
|
@ -0,0 +1,4 @@
|
|||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
from . import purchase_order
|
||||
from . import res_company
|
||||
from . import res_config_settings
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
# Copyright 2024 Onestein
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
from odoo import api, fields, models
|
||||
|
||||
from odoo.addons.purchase.models.purchase import PurchaseOrder as Purchase
|
||||
|
||||
|
||||
class PurchaseOrder(models.Model):
|
||||
_inherit = "purchase.order"
|
||||
|
||||
require_signature = fields.Boolean(
|
||||
string="Online Signature",
|
||||
compute="_compute_require_signature",
|
||||
store=True,
|
||||
readonly=False,
|
||||
precompute=True,
|
||||
states=Purchase.READONLY_STATES,
|
||||
help="Request a online signature and/or payment to the customer in "
|
||||
"order to confirm orders automatically.",
|
||||
)
|
||||
signature = fields.Image(
|
||||
copy=False, attachment=True, max_width=1024, max_height=1024
|
||||
)
|
||||
signed_by = fields.Char(copy=False)
|
||||
signed_on = fields.Datetime(copy=False)
|
||||
|
||||
@api.depends("company_id")
|
||||
def _compute_require_signature(self):
|
||||
for order in self:
|
||||
order.require_signature = order.company_id.purchase_portal_confirmation_sign
|
||||
|
||||
def _has_to_be_signed(self):
|
||||
return self.state == "sent" and self.require_signature and not self.signature
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# Copyright 2024 Onestein
|
||||
# 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_portal_confirmation_sign = fields.Boolean(
|
||||
string="Purchase Online Signature", default=False
|
||||
)
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# Copyright 2024 Onestein
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = "res.config.settings"
|
||||
|
||||
purchase_portal_confirmation_sign = fields.Boolean(
|
||||
related="company_id.purchase_portal_confirmation_sign",
|
||||
readonly=False,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue