mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] - Add primary views for contract
[IMP] - don't use related filed for partner_id and pricelist_id
This commit is contained in:
@@ -79,13 +79,6 @@ class AccountAbstractAnalyticContractLine(models.AbstractModel):
|
|||||||
help="Repeat every (Days/Week/Month/Year)",
|
help="Repeat every (Days/Week/Month/Year)",
|
||||||
required=True,
|
required=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
partner_id = fields.Many2one(
|
|
||||||
comodel_name="res.partner", string="Partner (always False)"
|
|
||||||
)
|
|
||||||
pricelist_id = fields.Many2one(
|
|
||||||
comodel_name='product.pricelist', string='Pricelist'
|
|
||||||
)
|
|
||||||
recurring_next_date = fields.Date(string='Date of Next Invoice')
|
recurring_next_date = fields.Date(string='Date of Next Invoice')
|
||||||
|
|
||||||
is_canceled = fields.Boolean(string="Canceled", default=False)
|
is_canceled = fields.Boolean(string="Canceled", default=False)
|
||||||
@@ -109,14 +102,21 @@ class AccountAbstractAnalyticContractLine(models.AbstractModel):
|
|||||||
default='monthly',
|
default='monthly',
|
||||||
string='Termination Notice type',
|
string='Termination Notice type',
|
||||||
)
|
)
|
||||||
|
contract_id = fields.Many2one(
|
||||||
|
string='Contract',
|
||||||
|
comodel_name='account.abstract.analytic.contract',
|
||||||
|
required=True,
|
||||||
|
ondelete='cascade',
|
||||||
|
oldname='analytic_account_id',
|
||||||
|
)
|
||||||
|
|
||||||
@api.depends(
|
@api.depends(
|
||||||
'automatic_price',
|
'automatic_price',
|
||||||
'specific_price',
|
'specific_price',
|
||||||
'product_id',
|
'product_id',
|
||||||
'quantity',
|
'quantity',
|
||||||
'pricelist_id',
|
'contract_id.pricelist_id',
|
||||||
'partner_id',
|
'contract_id.partner_id',
|
||||||
)
|
)
|
||||||
def _compute_price_unit(self):
|
def _compute_price_unit(self):
|
||||||
"""Get the specific price if no auto-price, and the price obtained
|
"""Get the specific price if no auto-price, and the price obtained
|
||||||
@@ -128,8 +128,8 @@ class AccountAbstractAnalyticContractLine(models.AbstractModel):
|
|||||||
quantity=line.env.context.get(
|
quantity=line.env.context.get(
|
||||||
'contract_line_qty', line.quantity
|
'contract_line_qty', line.quantity
|
||||||
),
|
),
|
||||||
pricelist=line.pricelist_id.id,
|
pricelist=line.contract_id.pricelist_id.id,
|
||||||
partner=line.partner_id.id,
|
partner=line.contract_id.partner_id.id,
|
||||||
date=line.env.context.get('old_date', fields.Date.today()),
|
date=line.env.context.get('old_date', fields.Date.today()),
|
||||||
)
|
)
|
||||||
line.price_unit = product.price
|
line.price_unit = product.price
|
||||||
@@ -150,8 +150,8 @@ class AccountAbstractAnalyticContractLine(models.AbstractModel):
|
|||||||
subtotal = line.quantity * line.price_unit
|
subtotal = line.quantity * line.price_unit
|
||||||
discount = line.discount / 100
|
discount = line.discount / 100
|
||||||
subtotal *= 1 - discount
|
subtotal *= 1 - discount
|
||||||
if line.pricelist_id:
|
if line.contract_id.pricelist_id:
|
||||||
cur = line.pricelist_id.currency_id
|
cur = line.contract_id.pricelist_id.currency_id
|
||||||
line.price_subtotal = cur.round(subtotal)
|
line.price_subtotal = cur.round(subtotal)
|
||||||
else:
|
else:
|
||||||
line.price_subtotal = subtotal
|
line.price_subtotal = subtotal
|
||||||
@@ -183,14 +183,14 @@ class AccountAbstractAnalyticContractLine(models.AbstractModel):
|
|||||||
vals['uom_id'] = self.product_id.uom_id
|
vals['uom_id'] = self.product_id.uom_id
|
||||||
|
|
||||||
date = self.recurring_next_date or fields.Date.today()
|
date = self.recurring_next_date or fields.Date.today()
|
||||||
partner = self.partner_id or self.env.user.partner_id
|
partner = self.contract_id.partner_id or self.env.user.partner_id
|
||||||
|
|
||||||
product = self.product_id.with_context(
|
product = self.product_id.with_context(
|
||||||
lang=partner.lang,
|
lang=partner.lang,
|
||||||
partner=partner.id,
|
partner=partner.id,
|
||||||
quantity=self.quantity,
|
quantity=self.quantity,
|
||||||
date=date,
|
date=date,
|
||||||
pricelist=self.pricelist_id.id,
|
pricelist=self.contract_id.pricelist_id.id,
|
||||||
uom=self.uom_id.id,
|
uom=self.uom_id.id,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -26,20 +26,6 @@ class AccountAnalyticInvoiceLine(models.Model):
|
|||||||
create_invoice_visibility = fields.Boolean(
|
create_invoice_visibility = fields.Boolean(
|
||||||
compute='_compute_create_invoice_visibility'
|
compute='_compute_create_invoice_visibility'
|
||||||
)
|
)
|
||||||
partner_id = fields.Many2one(
|
|
||||||
comodel_name="res.partner",
|
|
||||||
string="Partner (always False)",
|
|
||||||
related='contract_id.partner_id',
|
|
||||||
store=True,
|
|
||||||
readonly=True,
|
|
||||||
)
|
|
||||||
pricelist_id = fields.Many2one(
|
|
||||||
comodel_name='product.pricelist',
|
|
||||||
string='Pricelist',
|
|
||||||
related='contract_id.pricelist_id',
|
|
||||||
store=True,
|
|
||||||
readonly=True,
|
|
||||||
)
|
|
||||||
successor_contract_line_id = fields.Many2one(
|
successor_contract_line_id = fields.Many2one(
|
||||||
comodel_name='account.analytic.invoice.line',
|
comodel_name='account.analytic.invoice.line',
|
||||||
string="Successor Contract Line",
|
string="Successor Contract Line",
|
||||||
@@ -793,3 +779,25 @@ class AccountAnalyticInvoiceLine(models.Model):
|
|||||||
domain = self._contract_line_to_renew_domain()
|
domain = self._contract_line_to_renew_domain()
|
||||||
to_renew = self.search(domain)
|
to_renew = self.search(domain)
|
||||||
to_renew.renew()
|
to_renew.renew()
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def fields_view_get(
|
||||||
|
self, view_id=None, view_type='form', toolbar=False, submenu=False
|
||||||
|
):
|
||||||
|
default_contract_type = self.env.context.get('default_contract_type')
|
||||||
|
if view_type == 'tree' and default_contract_type == 'purchase':
|
||||||
|
view_id = self.env.ref(
|
||||||
|
'contract.account_analytic_invoice_line_purchase_view_tree'
|
||||||
|
).id
|
||||||
|
if view_type == 'form':
|
||||||
|
if default_contract_type == 'purchase':
|
||||||
|
view_id = self.env.ref(
|
||||||
|
'contract.account_analytic_invoice_line_purchase_view_form'
|
||||||
|
).id
|
||||||
|
elif default_contract_type == 'sale':
|
||||||
|
view_id = self.env.ref(
|
||||||
|
'contract.account_analytic_invoice_line_sale_view_form'
|
||||||
|
).id
|
||||||
|
return super(AccountAnalyticInvoiceLine, self).fields_view_get(
|
||||||
|
view_id, view_type, toolbar, submenu
|
||||||
|
)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class AccountAnalyticContract(models.Model):
|
|||||||
|
|
||||||
recurring_invoice_line_ids = fields.One2many(
|
recurring_invoice_line_ids = fields.One2many(
|
||||||
comodel_name='account.analytic.contract.line',
|
comodel_name='account.analytic.contract.line',
|
||||||
inverse_name='contract_template_id',
|
inverse_name='contract_id',
|
||||||
copy=True,
|
copy=True,
|
||||||
string='Invoice Lines',
|
string='Invoice Lines',
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -15,24 +15,10 @@ class AccountAnalyticContractLine(models.Model):
|
|||||||
_description = 'Contract Lines'
|
_description = 'Contract Lines'
|
||||||
_order = "sequence,id"
|
_order = "sequence,id"
|
||||||
|
|
||||||
contract_template_id = fields.Many2one(
|
contract_id = fields.Many2one(
|
||||||
string='Contract',
|
string='Contract',
|
||||||
comodel_name='account.analytic.contract',
|
comodel_name='account.analytic.contract',
|
||||||
required=True,
|
required=True,
|
||||||
ondelete='cascade',
|
ondelete='cascade',
|
||||||
oldname='analytic_account_id',
|
oldname='analytic_account_id',
|
||||||
)
|
)
|
||||||
partner_id = fields.Many2one(
|
|
||||||
comodel_name="res.partner",
|
|
||||||
string="Partner (always False)",
|
|
||||||
related='contract_template_id.partner_id',
|
|
||||||
store=True,
|
|
||||||
readonly=True,
|
|
||||||
)
|
|
||||||
pricelist_id = fields.Many2one(
|
|
||||||
comodel_name='product.pricelist',
|
|
||||||
string='Pricelist',
|
|
||||||
related='contract_template_id.pricelist_id',
|
|
||||||
store=True,
|
|
||||||
readonly=True,
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class TestContract(TestContractBase):
|
|||||||
del vals['contract_id']
|
del vals['contract_id']
|
||||||
del vals['date_start']
|
del vals['date_start']
|
||||||
del vals['date_end']
|
del vals['date_end']
|
||||||
vals['contract_template_id'] = self.template.id
|
vals['contract_id'] = self.template.id
|
||||||
vals.update(overrides)
|
vals.update(overrides)
|
||||||
return self.env['account.analytic.contract.line'].create(vals)
|
return self.env['account.analytic.contract.line'].create(vals)
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<field name="specific_price" invisible="1"/>
|
<field name="specific_price" invisible="1"/>
|
||||||
<field colspan="2" name="price_unit"
|
<field colspan="2" name="price_unit"
|
||||||
attrs="{'readonly': [('automatic_price', '=', True)]}"/>
|
attrs="{'readonly': [('automatic_price', '=', True)]}"/>
|
||||||
<field colspan="2" name="discount"/>
|
<field colspan="2" name="discount" groups="base.group_no_one"/>
|
||||||
</group>
|
</group>
|
||||||
<group col="4">
|
<group col="4">
|
||||||
<field colspan="2" name="is_auto_renew"/>
|
<field colspan="2" name="is_auto_renew"/>
|
||||||
|
|||||||
@@ -5,140 +5,110 @@
|
|||||||
model="ir.ui.view">
|
model="ir.ui.view">
|
||||||
<field name="name">Contract form</field>
|
<field name="name">Contract form</field>
|
||||||
<field name="model">account.analytic.account</field>
|
<field name="model">account.analytic.account</field>
|
||||||
<field name="inherit_id"
|
|
||||||
ref="analytic.view_account_analytic_account_form"/>
|
|
||||||
<field name="mode">primary</field>
|
|
||||||
<field name="priority" eval="9999"/>
|
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="partner_id" position="attributes">
|
<form>
|
||||||
<attribute name="attrs">{'required': [('recurring_invoices',
|
|
||||||
'=', True)]}
|
|
||||||
</attribute>
|
|
||||||
</field>
|
|
||||||
<xpath expr="//div[@name='button_box']/.." position="before">
|
|
||||||
<header>
|
<header>
|
||||||
<button name="action_contract_send" type="object"
|
<button name="action_contract_send"
|
||||||
string="Send by Email" groups="base.group_user"/>
|
type="object"
|
||||||
</header>
|
string="Send by Email"
|
||||||
</xpath>
|
groups="base.group_user"/>
|
||||||
<xpath expr='//field[@name="code"]' position='before'>
|
|
||||||
<field name="contract_type" invisible="1" required="1"/>
|
|
||||||
</xpath>
|
|
||||||
<group name="main" position="after">
|
|
||||||
<separator string="Recurring Invoices"
|
|
||||||
attrs="{'invisible': [('recurring_invoices','!=',True)]}"
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
<field name="recurring_invoices" class="oe_inline"/>
|
|
||||||
<field name="create_invoice_visibility" invisible="1"/>
|
|
||||||
<label for="recurring_invoices"/>
|
|
||||||
<button name="recurring_create_invoice"
|
<button name="recurring_create_invoice"
|
||||||
type="object"
|
type="object"
|
||||||
attrs="{'invisible': ['|', ('recurring_invoices', '!=', True), ('create_invoice_visibility', '=', False)]}"
|
attrs="{'invisible': [('create_invoice_visibility', '=', False)]}"
|
||||||
string="Create invoices"
|
string="Create invoices"
|
||||||
class="oe_link"
|
groups="base.group_no_one"/>
|
||||||
groups="base.group_no_one"
|
</header>
|
||||||
/>
|
<sheet string="Contract">
|
||||||
<button name="contract.act_recurring_invoices"
|
<div class="oe_button_box" name="button_box">
|
||||||
type="action"
|
<button class="oe_stat_button" type="object"
|
||||||
attrs="{'invisible': [('recurring_invoices','!=',True)]}"
|
name="toggle_active" icon="fa-archive">
|
||||||
string="⇒ Show recurring invoices"
|
<field name="active" widget="boolean_button"
|
||||||
class="oe_link"
|
options="{"terminology": "archive"}"/>
|
||||||
/>
|
</button>
|
||||||
</div>
|
|
||||||
<group col="4"
|
<button name="contract.act_recurring_invoices"
|
||||||
attrs="{'invisible': [('recurring_invoices','!=',True)]}">
|
type="action"
|
||||||
<field name="contract_template_id" colspan="4"
|
string="Invoices"
|
||||||
domain="['|', ('contract_type', '=', contract_type), ('contract_type', '=', False)]"
|
icon="fa-list"
|
||||||
context="{'default_contract_type': contract_type}"/>
|
class="oe_stat_button"/>
|
||||||
<field name="journal_id"
|
</div>
|
||||||
domain="[('type', '=', contract_type),('company_id', '=', company_id)]"
|
<div class="oe_title">
|
||||||
attrs="{'required': [('recurring_invoices', '=', True)]}"
|
<label for="name" string="Contract Name"
|
||||||
/>
|
class="oe_edit_only"/>
|
||||||
<field name="pricelist_id"/>
|
<h3>
|
||||||
<field name="recurring_next_date"/>
|
<field name="name" class="oe_inline"
|
||||||
<field name="date_end"/>
|
placeholder="e.g. Contract XYZ"/>
|
||||||
<field name="company_id"
|
</h3>
|
||||||
groups="base.group_multi_company"/>
|
</div>
|
||||||
</group>
|
<group name="main">
|
||||||
<label for="recurring_invoice_line_ids"
|
<group>
|
||||||
attrs="{'invisible': [('recurring_invoices','=',False)]}"
|
<field name="partner_id" required="1"/>
|
||||||
/>
|
</group>
|
||||||
<div attrs="{'invisible': [('recurring_invoices','=',False)]}">
|
<group>
|
||||||
<field name="recurring_invoice_line_ids">
|
<field name="contract_template_id"
|
||||||
<tree decoration-muted="is_canceled" decoration-info="create_invoice_visibility and not is_canceled">
|
domain="['|', ('contract_type', '=', contract_type), ('contract_type', '=', False)]"
|
||||||
<field name="sequence" widget="handle"/>
|
context="{'default_contract_type': contract_type}"/>
|
||||||
<field name="product_id"/>
|
<field name="contract_type" invisible="1"
|
||||||
<field name="name"/>
|
required="1"/>
|
||||||
<field name="quantity"/>
|
</group>
|
||||||
<field name="uom_id"/>
|
</group>
|
||||||
<field name="automatic_price"/>
|
|
||||||
<field name="price_unit"
|
<group name="recurring_invoices">
|
||||||
attrs="{'readonly': [('automatic_price', '=', True)]}"/>
|
<group>
|
||||||
<field name="specific_price" invisible="1"/>
|
<field name="journal_id" required="1"/>
|
||||||
<field name="discount" groups="base.group_no_one"/>
|
<field name="recurring_next_date"/>
|
||||||
<field name="price_subtotal"/>
|
</group>
|
||||||
<field name="recurring_interval" invisible="1"/>
|
<group>
|
||||||
<field name="recurring_rule_type" invisible="1"/>
|
<field name="pricelist_id"/>
|
||||||
<field name="recurring_invoicing_type"
|
|
||||||
invisible="1"/>
|
|
||||||
<field name="date_start" required="1"/>
|
|
||||||
<field name="date_end"/>
|
<field name="date_end"/>
|
||||||
<field name="recurring_next_date" required="1" attrs="{'invisible': [('create_invoice_visibility', '=', False)]}"/>
|
</group>
|
||||||
|
</group>
|
||||||
|
<notebook>
|
||||||
|
<page name="recurring_invoice_line"
|
||||||
|
string="Recurring Invoices">
|
||||||
|
<field name="recurring_invoice_line_ids" context="{'default_contract_type': contract_type}"/>
|
||||||
|
</page>
|
||||||
|
<page name="info" string="Other Information">
|
||||||
|
<div invisible="1">
|
||||||
|
<field name="recurring_invoices"
|
||||||
|
class="oe_inline"/>
|
||||||
|
<label for="recurring_invoices"/>
|
||||||
|
</div>
|
||||||
<field name="create_invoice_visibility"
|
<field name="create_invoice_visibility"
|
||||||
invisible="1"/>
|
invisible="1"/>
|
||||||
<field name="is_plan_successor_allowed" invisible="1"/>
|
<group>
|
||||||
<field name="is_stop_plan_successor_allowed" invisible="1"/>
|
<field name="code"/>
|
||||||
<field name="is_stop_allowed" invisible="1"/>
|
<field name="group_id"/>
|
||||||
<field name="is_cancel_allowed" invisible="1"/>
|
<field name="company_id"
|
||||||
<field name="is_un_cancel_allowed" invisible="1"/>
|
options="{'no_create': True}"
|
||||||
<field name="is_auto_renew" invisible="1"/>
|
groups="base.group_multi_company"/>
|
||||||
<field name="is_canceled" invisible="1"/>
|
<field name="currency_id"
|
||||||
<button name="action_plan_successor"
|
options="{'no_create': True}"
|
||||||
string="Plan Start"
|
groups="base.group_multi_currency"/>
|
||||||
type="object"
|
</group>
|
||||||
icon="fa-calendar text-success"
|
<group string="Legend (for the markers inside invoice lines description)"
|
||||||
attrs="{'invisible': [('is_plan_successor_allowed', '=', False)]}"/>
|
name="group_legend">
|
||||||
<button name="action_stop_plan_successor"
|
<p colspan="2"><strong>#START#</strong>: Start
|
||||||
string="Stop Plan Successor"
|
date
|
||||||
type="object"
|
of the
|
||||||
icon="fa-pause text-muted"
|
invoiced period
|
||||||
attrs="{'invisible': [('is_stop_plan_successor_allowed', '=', False)]}"/>
|
</p>
|
||||||
<button name="action_stop"
|
<p colspan="2"><strong>#END#</strong>: End date
|
||||||
string="Stop"
|
of
|
||||||
type="object"
|
the
|
||||||
icon="fa-stop text-danger"
|
invoiced period
|
||||||
attrs="{'invisible': [('is_stop_allowed', '=', False)]}"/>
|
</p>
|
||||||
<button name="cancel"
|
</group>
|
||||||
string="Cancel"
|
</page>
|
||||||
type="object"
|
</notebook>
|
||||||
icon="fa-ban text-danger"
|
</sheet>
|
||||||
attrs="{'invisible': [('is_cancel_allowed', '=', False)]}"/>
|
<div class="oe_chatter">
|
||||||
<button name="action_uncancel"
|
<field name="message_follower_ids"
|
||||||
string="Un-cancel"
|
widget="mail_followers"/>
|
||||||
type="object"
|
<field name="message_ids" widget="mail_thread"/>
|
||||||
icon="fa-ban text-success"
|
|
||||||
attrs="{'invisible': [('is_un_cancel_allowed', '=', False)]}"/>
|
|
||||||
<button name="renew"
|
|
||||||
string="Renew"
|
|
||||||
type="object"
|
|
||||||
icon="fa-fast-forward text-success"
|
|
||||||
groups="base.group_no_one"
|
|
||||||
attrs="{'invisible': [('is_auto_renew', '=', False)]}"/>
|
|
||||||
</tree>
|
|
||||||
</field>
|
|
||||||
</div>
|
</div>
|
||||||
<group string="Legend (for the markers inside invoice lines description)"
|
</form>
|
||||||
name="group_legend"
|
|
||||||
attrs="{'invisible': [('recurring_invoices','!=',True)]}">
|
|
||||||
<p colspan="2"><strong>#START#</strong>: Start date of the
|
|
||||||
invoiced period
|
|
||||||
</p>
|
|
||||||
<p colspan="2"><strong>#END#</strong>: End date of the
|
|
||||||
invoiced period
|
|
||||||
</p>
|
|
||||||
</group>
|
|
||||||
</group>
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
@@ -160,9 +130,6 @@
|
|||||||
<field name="journal_id" position="attributes">
|
<field name="journal_id" position="attributes">
|
||||||
<attribute name="domain">[('type', '=', 'sale'),('company_id', '=', company_id)]</attribute>
|
<attribute name="domain">[('type', '=', 'sale'),('company_id', '=', company_id)]</attribute>
|
||||||
</field>
|
</field>
|
||||||
<field name="product_id" position="attributes">
|
|
||||||
<attribute name="domain">[('sale_ok', '=', True)]</attribute>
|
|
||||||
</field>
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
@@ -184,14 +151,6 @@
|
|||||||
<field name="journal_id" position="attributes">
|
<field name="journal_id" position="attributes">
|
||||||
<attribute name="domain">[('type', '=', 'purchase'),('company_id', '=', company_id)]</attribute>
|
<attribute name="domain">[('type', '=', 'purchase'),('company_id', '=', company_id)]</attribute>
|
||||||
</field>
|
</field>
|
||||||
<field name="product_id" position="attributes">
|
|
||||||
<attribute name="domain">[('purchase_ok', '=', True)]
|
|
||||||
</attribute>
|
|
||||||
</field>
|
|
||||||
<xpath expr="//field[@name='recurring_invoice_line_ids']/tree/field[@name='automatic_price']"
|
|
||||||
position="attributes">
|
|
||||||
<attribute name="invisible">True</attribute>
|
|
||||||
</xpath>
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,11 @@
|
|||||||
<group>
|
<group>
|
||||||
<field name="create_invoice_visibility" invisible="1"/>
|
<field name="create_invoice_visibility" invisible="1"/>
|
||||||
<field name="date_start" required="1"/>
|
<field name="date_start" required="1"/>
|
||||||
<field name="recurring_next_date" attrs="{'invisible': [('create_invoice_visibility', '=', False)]}"/>
|
<field name="recurring_next_date"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="date_end" attrs="{'required': [('is_auto_renew', '=', True)]}"/>
|
<field name="date_end"
|
||||||
|
attrs="{'required': [('is_auto_renew', '=', True)]}"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="predecessor_contract_line_id"/>
|
<field name="predecessor_contract_line_id"/>
|
||||||
@@ -35,4 +36,129 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="account_analytic_invoice_line_sale_view_form"
|
||||||
|
model="ir.ui.view">
|
||||||
|
<field name="name">account.analytic.invoice.line.sale.form</field>
|
||||||
|
<field name="model">account.analytic.invoice.line</field>
|
||||||
|
<field name="inherit_id"
|
||||||
|
ref="account_analytic_invoice_line_view_form"/>
|
||||||
|
<field name="mode">primary</field>
|
||||||
|
<field name="priority" eval="20"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="product_id" position="attributes">
|
||||||
|
<attribute name="domain">[('sale_ok', '=', True)]</attribute>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="account_analytic_invoice_line_purchase_view_form"
|
||||||
|
model="ir.ui.view">
|
||||||
|
<field name="name">account.analytic.invoice.line.purchase.form</field>
|
||||||
|
<field name="model">account.analytic.invoice.line</field>
|
||||||
|
<field name="inherit_id"
|
||||||
|
ref="account_analytic_invoice_line_view_form"/>
|
||||||
|
<field name="mode">primary</field>
|
||||||
|
<field name="priority" eval="20"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="product_id" position="attributes">
|
||||||
|
<attribute name="domain">[('purchase_ok', '=', True)]
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<xpath expr="//field[@name='automatic_price']"
|
||||||
|
position="attributes">
|
||||||
|
<attribute name="invisible">True</attribute>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="account_analytic_invoice_line_view_tree" model="ir.ui.view">
|
||||||
|
<field name="name">account.analytic.invoice.line.tree</field>
|
||||||
|
<field name="model">account.analytic.invoice.line</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree decoration-muted="is_canceled"
|
||||||
|
decoration-info="create_invoice_visibility and not is_canceled">
|
||||||
|
<field name="sequence" widget="handle"/>
|
||||||
|
<field name="product_id"/>
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="quantity"/>
|
||||||
|
<field name="uom_id"/>
|
||||||
|
<field name="automatic_price"/>
|
||||||
|
<field name="price_unit"
|
||||||
|
attrs="{'readonly': [('automatic_price', '=', True)]}"/>
|
||||||
|
<field name="specific_price"
|
||||||
|
invisible="1"/>
|
||||||
|
<field name="discount"
|
||||||
|
groups="base.group_no_one"/>
|
||||||
|
<field name="price_subtotal"/>
|
||||||
|
<field name="recurring_interval"
|
||||||
|
invisible="1"/>
|
||||||
|
<field name="recurring_rule_type"
|
||||||
|
invisible="1"/>
|
||||||
|
<field name="recurring_invoicing_type"
|
||||||
|
invisible="1"/>
|
||||||
|
<field name="date_start" required="1"/>
|
||||||
|
<field name="date_end"/>
|
||||||
|
<field name="recurring_next_date"
|
||||||
|
required="1"
|
||||||
|
attrs="{'invisible': [('create_invoice_visibility', '=', False)]}"/>
|
||||||
|
<field name="create_invoice_visibility"
|
||||||
|
invisible="1"/>
|
||||||
|
<field name="is_plan_successor_allowed"
|
||||||
|
invisible="1"/>
|
||||||
|
<field name="is_stop_plan_successor_allowed"
|
||||||
|
invisible="1"/>
|
||||||
|
<field name="is_stop_allowed"
|
||||||
|
invisible="1"/>
|
||||||
|
<field name="is_cancel_allowed"
|
||||||
|
invisible="1"/>
|
||||||
|
<field name="is_un_cancel_allowed"
|
||||||
|
invisible="1"/>
|
||||||
|
<field name="is_auto_renew" invisible="1"/>
|
||||||
|
<field name="is_canceled" invisible="1"/>
|
||||||
|
<button name="action_plan_successor"
|
||||||
|
string="Plan Start" type="object"
|
||||||
|
icon="fa-calendar text-success"
|
||||||
|
attrs="{'invisible': [('is_plan_successor_allowed', '=', False)]}"/>
|
||||||
|
<button name="action_stop_plan_successor"
|
||||||
|
string="Stop Plan Successor"
|
||||||
|
type="object"
|
||||||
|
icon="fa-pause text-muted"
|
||||||
|
attrs="{'invisible': [('is_stop_plan_successor_allowed', '=', False)]}"/>
|
||||||
|
<button name="action_stop" string="Stop"
|
||||||
|
type="object"
|
||||||
|
icon="fa-stop text-danger"
|
||||||
|
attrs="{'invisible': [('is_stop_allowed', '=', False)]}"/>
|
||||||
|
<button name="cancel" string="Cancel"
|
||||||
|
type="object"
|
||||||
|
icon="fa-ban text-danger"
|
||||||
|
attrs="{'invisible': [('is_cancel_allowed', '=', False)]}"/>
|
||||||
|
<button name="action_uncancel"
|
||||||
|
string="Un-cancel" type="object"
|
||||||
|
icon="fa-ban text-success"
|
||||||
|
attrs="{'invisible': [('is_un_cancel_allowed', '=', False)]}"/>
|
||||||
|
<button name="renew" string="Renew"
|
||||||
|
type="object"
|
||||||
|
icon="fa-fast-forward text-success"
|
||||||
|
groups="base.group_no_one"
|
||||||
|
attrs="{'invisible': [('is_auto_renew', '=', False)]}"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="account_analytic_invoice_line_purchase_view_tree"
|
||||||
|
model="ir.ui.view">
|
||||||
|
<field name="name">account.analytic.invoice.line.purchase.tree</field>
|
||||||
|
<field name="model">account.analytic.invoice.line</field>
|
||||||
|
<field name="mode">primary</field>
|
||||||
|
<field name="priority" eval="20"/>
|
||||||
|
<field name="inherit_id"
|
||||||
|
ref="account_analytic_invoice_line_view_tree"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='automatic_price']"
|
||||||
|
position="attributes">
|
||||||
|
<attribute name="invisible">True</attribute>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user