Public release from ruodoo-project: 19.0 - 2026-05-10 21:19:01 UTC
This commit is contained in:
1
l10n_ru_contract_templates/__init__.py
Normal file
1
l10n_ru_contract_templates/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from . import models
|
||||
18
l10n_ru_contract_templates/__manifest__.py
Normal file
18
l10n_ru_contract_templates/__manifest__.py
Normal file
@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
{
|
||||
"name": "Russian Contracts – DOCX Templates",
|
||||
"summary": "Связка договоров и DOCX-шаблонов для l10n_ru_contract",
|
||||
"version": "19.0.1.0.0",
|
||||
"category": "Accounting",
|
||||
"author": "MK.Lab",
|
||||
"depends": [
|
||||
"web",
|
||||
"l10n_ru_contract",
|
||||
"docx_report",
|
||||
],
|
||||
"data": [
|
||||
"views/partner_contract_customer_views.xml",
|
||||
"views/contract_profile_views.xml",
|
||||
],
|
||||
"installable": True,
|
||||
}
|
||||
2
l10n_ru_contract_templates/models/__init__.py
Normal file
2
l10n_ru_contract_templates/models/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
from . import partner_contract_customer
|
||||
from . import contract_profile
|
||||
6
l10n_ru_contract_templates/models/contract_profile.py
Normal file
6
l10n_ru_contract_templates/models/contract_profile.py
Normal file
@ -0,0 +1,6 @@
|
||||
from odoo import models
|
||||
|
||||
|
||||
class ContractProfile(models.Model):
|
||||
_name = 'contract.profile'
|
||||
_inherit = ["contract.profile", "docx.template.mixin"]
|
||||
@ -0,0 +1,12 @@
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class PartnerContractCustomer(models.Model):
|
||||
_name = "partner.contract.customer"
|
||||
_inherit = ["partner.contract.customer", "docx.template.mixin"]
|
||||
|
||||
@api.onchange("profile_id")
|
||||
def _onchange_profile_id_set_docx_template(self):
|
||||
for rec in self:
|
||||
if rec.profile_id and not rec.docx_template_id and rec.profile_id.docx_template_id:
|
||||
rec.docx_template_id = rec.profile_id.docx_template_id
|
||||
18
l10n_ru_contract_templates/views/contract_profile_views.xml
Normal file
18
l10n_ru_contract_templates/views/contract_profile_views.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<odoo>
|
||||
<record id="contract_profile_view_docx_template" model="ir.ui.view">
|
||||
<field name="name">contract.profile.form.docx.template</field>
|
||||
<field name="model">contract.profile</field>
|
||||
<field name="inherit_id" ref="l10n_ru_contract.contract_profile_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//form/sheet" position="inside">
|
||||
<notebook>
|
||||
<page string="Шаблон DOCX">
|
||||
<group>
|
||||
<field name="docx_template_id"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@ -0,0 +1,16 @@
|
||||
<odoo>
|
||||
<record id="contract_customer_form_docx_template" model="ir.ui.view">
|
||||
<field name="name">contract.customer.form.docx.template</field>
|
||||
<field name="model">partner.contract.customer</field>
|
||||
<field name="inherit_id" ref="l10n_ru_contract.contract_customer_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//form/sheet/notebook" position="inside">
|
||||
<page string="Шаблон DOCX">
|
||||
<group>
|
||||
<field name="docx_template_id"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user