@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<record id="multiple_invoice_sample_name" model="multiple.invoice"> |
|||
<field name="copy_name">Sample Name</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,49 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class MultipleInvoice(models.Model): |
|||
"""Multiple Invoice Model""" |
|||
_name = "multiple.invoice" |
|||
_order = "sequence" |
|||
|
|||
sequence = fields.Integer('Sequence No') |
|||
|
|||
copy_name = fields.Char('Invoice Copy Name') |
|||
|
|||
journal_id = fields.Many2one('account.journal', string="Journal") |
|||
|
|||
|
|||
class AccountJournal(models.Model): |
|||
"""Inheriting Account Journal Model""" |
|||
_inherit = "account.journal" |
|||
|
|||
multiple_invoice_ids = fields.One2many('multiple.invoice', 'journal_id', |
|||
string='Multiple Invoice') |
|||
|
|||
multiple_invoice_type = fields.Selection( |
|||
[('text', 'Text'), ('watermark', 'Watermark')], required=True, |
|||
default='text', string="Display Type") |
|||
|
|||
text_position = fields.Selection([ |
|||
('header', 'Header'), |
|||
('footer', 'Footer'), |
|||
('body', 'Document Body') |
|||
], required=True, default='header') |
|||
|
|||
body_text_position = fields.Selection([ |
|||
('tl', 'Top Left'), |
|||
('tr', 'Top Right'), |
|||
('bl', 'Bottom Left'), |
|||
('br', 'Bottom Right'), |
|||
|
|||
], default='tl') |
|||
|
|||
text_align = fields.Selection([ |
|||
('right', 'Right'), |
|||
('left', 'Left'), |
|||
('center', 'Center'), |
|||
|
|||
], default='right') |
|||
|
|||
layout = fields.Char(related="company_id.external_report_layout_id.key") |
@ -0,0 +1,151 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from odoo import api, fields, models |
|||
|
|||
from odoo.modules import get_resource_path |
|||
|
|||
try: |
|||
import sass as libsass |
|||
except ImportError: |
|||
libsass = None |
|||
|
|||
|
|||
class MultipleInvoiceLayout(models.TransientModel): |
|||
""" |
|||
Customise the invoice copy document layout and display a live preview |
|||
""" |
|||
|
|||
_name = 'multiple.invoice.layout' |
|||
_description = 'Multiple Invoice Document Layout' |
|||
|
|||
def _get_default_journal(self): |
|||
return self.env['account.journal'].search( |
|||
[('id', '=', self.env.context.get('active_id'))]).id |
|||
|
|||
company_id = fields.Many2one( |
|||
'res.company', default=lambda self: self.env.company, required=True) |
|||
|
|||
layout = fields.Char(related="company_id.external_report_layout_id.key") |
|||
|
|||
journal_id = fields.Many2one('account.journal', string='Journal', |
|||
required=True, default=_get_default_journal) |
|||
|
|||
multiple_invoice_type = fields.Selection( |
|||
related='journal_id.multiple_invoice_type', readonly=False, |
|||
required=True) |
|||
|
|||
text_position = fields.Selection(related='journal_id.text_position', |
|||
readonly=False, required=True, |
|||
default='header') |
|||
|
|||
body_text_position = fields.Selection( |
|||
related='journal_id.body_text_position', |
|||
readonly=False) |
|||
|
|||
text_align = fields.Selection( |
|||
related='journal_id.text_align', |
|||
readonly=False) |
|||
|
|||
preview = fields.Html(compute='_compute_preview', |
|||
sanitize=False, |
|||
sanitize_tags=False, |
|||
sanitize_attributes=False, |
|||
sanitize_style=False, |
|||
sanitize_form=False, |
|||
strip_style=False, |
|||
strip_classes=False) |
|||
|
|||
@api.depends('multiple_invoice_type', 'text_position', 'body_text_position', |
|||
'text_align') |
|||
def _compute_preview(self): |
|||
""" compute a qweb based preview to display on the wizard """ |
|||
|
|||
styles = self._get_asset_style() |
|||
|
|||
for wizard in self: |
|||
if wizard.company_id: |
|||
preview_css = self._get_css_for_preview(styles, wizard.id) |
|||
layout = self._get_layout_for_preview() |
|||
ir_ui_view = wizard.env['ir.ui.view'] |
|||
wizard.preview = ir_ui_view._render_template( |
|||
'base_accounting_kit.multiple_invoice_wizard_preview', |
|||
{'company': wizard.company_id, 'preview_css': preview_css, |
|||
'layout': layout, |
|||
'mi_type': self.multiple_invoice_type, |
|||
'txt_position': self.text_position, |
|||
'body_txt_position': self.body_text_position, |
|||
'txt_align': self.text_align, |
|||
'mi': self.env.ref( |
|||
'base_accounting_kit.multiple_invoice_sample_name') |
|||
}) |
|||
else: |
|||
wizard.preview = False |
|||
|
|||
def _get_asset_style(self): |
|||
template_style = self.env.ref('web.styles_company_report', |
|||
raise_if_not_found=False) |
|||
if not template_style: |
|||
return b'' |
|||
|
|||
company_styles = template_style._render({ |
|||
'company_ids': self.company_id, |
|||
}) |
|||
|
|||
return company_styles |
|||
|
|||
@api.model |
|||
def _get_css_for_preview(self, scss, new_id): |
|||
""" |
|||
Compile the scss into css. |
|||
""" |
|||
css_code = self._compile_scss(scss) |
|||
return css_code |
|||
|
|||
@api.model |
|||
def _compile_scss(self, scss_source): |
|||
""" |
|||
This code will compile valid scss into css. |
|||
Parameters are the same from odoo/addons/base/models/assetsbundle.py |
|||
Simply copied and adapted slightly |
|||
""" |
|||
|
|||
# No scss ? still valid, returns empty css |
|||
if not scss_source.strip(): |
|||
return "" |
|||
|
|||
precision = 8 |
|||
output_style = 'expanded' |
|||
bootstrap_path = get_resource_path('web', 'static', 'lib', 'bootstrap', |
|||
'scss') |
|||
|
|||
try: |
|||
return libsass.compile( |
|||
string=scss_source, |
|||
include_paths=[ |
|||
bootstrap_path, |
|||
], |
|||
output_style=output_style, |
|||
precision=precision, |
|||
) |
|||
except libsass.CompileError as e: |
|||
raise libsass.CompileError(e.args[0]) |
|||
|
|||
def _get_layout_for_preview(self): |
|||
if self.layout == 'web.external_layout_boxed': |
|||
new_layout = 'base_accounting_kit.boxed' |
|||
|
|||
elif self.layout == 'web.external_layout_clean': |
|||
new_layout = 'base_accounting_kit.clean' |
|||
|
|||
elif self.layout == 'web.external_layout_background': |
|||
new_layout = 'base_accounting_kit.background' |
|||
|
|||
else: |
|||
new_layout = 'base_accounting_kit.standard' |
|||
|
|||
return new_layout |
|||
|
|||
def document_layout_save(self): |
|||
# meant to be overridden |
|||
return self.env.context.get('report_action') or { |
|||
'type': 'ir.actions.act_window_close'} |
@ -0,0 +1,552 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
|
|||
<template id="base_accounting_kit.standard"> |
|||
<div t-attf-class="header o_company_#{company.id}_layout" t-att-style="report_header_style"> |
|||
<div class="row"> |
|||
<div class="col-3 mb4"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 45px;" alt="Logo"/> |
|||
<!--Header--> |
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'header'"> |
|||
<div class="row"> |
|||
<div t-if="txt_align == 'left'" class="text-left"> |
|||
<span t-esc="mi.copy_name" style="font-size: 20px; padding-left:25px; white-space:nowrap;"/> |
|||
</div> |
|||
<div t-if="txt_align == 'center'" class="text-center"> |
|||
<span t-esc="mi.copy_name" style="font-size: 20px; |
|||
margin-left:340px; margin-right:340px; white-space:nowrap;"/> |
|||
</div> |
|||
</div> |
|||
|
|||
</t> |
|||
</t> |
|||
</div> |
|||
<div class="col-9 text-right" style="margin-top:22px;" t-field="company.report_header" name="moto"/> |
|||
<!--Header--> |
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'header'"> |
|||
<div t-if="txt_align == 'right'" class="col-9 text-right"> |
|||
<span t-esc="mi.copy_name" style="font-size: 20px;"/> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
|
|||
</div> |
|||
<div t-if="company.logo or company.report_header" class="row zero_min_height"> |
|||
<div class="col-12"> |
|||
<div style="border-bottom: 1px solid black;"/> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-6" name="company_address"> |
|||
<div t-field="company.partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}' |
|||
/> |
|||
</div> |
|||
</div> |
|||
<!--Watermark--> |
|||
<t t-if="mi_type =='watermark'"> |
|||
<div style="opacity:0.15; font-size:100px; width:85%; text-align:center;top:500px; right:100px; position: fixed; z-index:99; -webkit-transform: rotate(-30deg);"> |
|||
<t t-esc="mi.copy_name"/> |
|||
</div> |
|||
</t> |
|||
</div> |
|||
|
|||
<div t-attf-class="article o_report_layout_standard o_company_#{company.id}_layout" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')"> |
|||
<div class="pt-5"> |
|||
<!-- This div ensures that the address is not cropped by the header. --> |
|||
<t t-call="web.address_layout"/> |
|||
</div> |
|||
<t t-raw="0"/> |
|||
</div> |
|||
|
|||
<div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout"> |
|||
<div class="text-center" style="border-top: 1px solid black;"> |
|||
<ul class="list-inline mb4"> |
|||
<!-- using the list-inline-item class from bootstrap causes weird behaviours in pdf report |
|||
adding d-inline class fixes the problem--> |
|||
<li t-if="company.phone" class="list-inline-item d-inline"><span class="o_force_ltr" t-field="company.phone"/></li> |
|||
<li t-if="company.email" class="list-inline-item d-inline"><span t-field="company.email"/></li> |
|||
<li t-if="company.website" class="list-inline-item d-inline"><span t-field="company.website"/></li> |
|||
<li t-if="company.vat" class="list-inline-item d-inline"><t t-esc="company.country_id.vat_label or 'Tax ID'"/>: <span t-field="company.vat"/></li> |
|||
|
|||
<!--Footer--> |
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'footer'"> |
|||
<div t-if="txt_align == 'right'" class="text-right"> |
|||
<span t-esc="mi.copy_name" style="font-size: 15px;"/> |
|||
</div> |
|||
<div t-if="txt_align == 'left'" class="text-left"> |
|||
<span t-esc="mi.copy_name" style="font-size: 15px;"/> |
|||
</div> |
|||
<div t-if="txt_align == 'center'" class="text-center;"> |
|||
<span t-esc="mi.copy_name" style="font-size: 15px;"/> |
|||
</div> |
|||
|
|||
</t> |
|||
</t> |
|||
|
|||
</ul> |
|||
|
|||
<div name="financial_infos"> |
|||
<span t-field="company.report_footer"/> |
|||
</div> |
|||
|
|||
<div t-if="report_type == 'pdf'" class="text-muted"> |
|||
Page: <span class="page"/> / <span class="topage"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<template id="base_accounting_kit.boxed"> |
|||
<div t-attf-class="header o_company_#{company.id}_layout" t-att-style="report_header_style"> |
|||
<div class="o_boxed_header"> |
|||
<div class="row mb8"> |
|||
<div class="col-6"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" alt="Logo"/> |
|||
<!--Header--> |
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'header'"> |
|||
<div t-if="txt_align == 'left'"> |
|||
<span t-esc="mi.copy_name" style="font-size: 25px; white-space:nowrap;"/> |
|||
</div> |
|||
<div t-if="txt_align == 'center'" class="text-align: center"> |
|||
<span t-esc="mi.copy_name" style="font-size: 25px; |
|||
margin-left:340px; margin-right:340px; white-space:nowrap;"/> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
|
|||
</div> |
|||
|
|||
|
|||
<div class="col-6 text-right mb4"> |
|||
<h4 class="mt0" t-field="company.report_header"/> |
|||
<div name="company_address" class="float-right mb4"> |
|||
<span class="company_address" t-field="company.partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/> |
|||
<!--Header--> |
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'header'"> |
|||
<div t-if="txt_align == 'right'" class="float-right mb4"> |
|||
<span t-esc="mi.copy_name" style="font-size: 25px;"/> |
|||
</div> |
|||
|
|||
</t> |
|||
</t> |
|||
<br/> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
</div> |
|||
<!--Watermark--> |
|||
<t t-if="mi_type =='watermark'"> |
|||
<div style="opacity:0.15; font-size:100px; width:85%; text-align:center;top:500px; right:100px; position: fixed; z-index:99; -webkit-transform: rotate(-30deg);"> |
|||
<t t-esc="mi.copy_name"/> |
|||
</div> |
|||
</t> |
|||
</div> |
|||
|
|||
<div t-attf-class="article o_report_layout_boxed o_company_#{company.id}_layout" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')"> |
|||
<div class="pt-5"> |
|||
<!-- This div ensures that the address is not cropped by the header. --> |
|||
<t t-call="web.address_layout"/> |
|||
</div> |
|||
<t t-raw="0"/> |
|||
</div> |
|||
|
|||
<div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout"> |
|||
<div class="text-center"> |
|||
<ul class="list-inline"> |
|||
<li t-if="company.phone" class="list-inline-item"><span class="o_force_ltr" t-field="company.phone"/></li> |
|||
<li t-if="company.email" class="list-inline-item"><span t-field="company.email"/></li> |
|||
<li t-if="company.website" class="list-inline-item"><span t-field="company.website"/></li> |
|||
<li t-if="company.vat" class="list-inline-item"><t t-esc="company.country_id.vat_label or 'Tax ID'"/>: <span t-field="company.vat"/></li> |
|||
</ul> |
|||
<div t-field="company.report_footer"/> |
|||
<!--Footer--> |
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'footer'"> |
|||
<div t-if="txt_align == 'right'" class="text-right"> |
|||
<span t-esc="mi.copy_name" style="font-size: 20px;"/> |
|||
</div> |
|||
<div t-if="txt_align == 'left'" class="text-left"> |
|||
<span t-esc="mi.copy_name" style="font-size: 20px;"/> |
|||
</div> |
|||
<div t-if="txt_align == 'center'" class="text-center;"> |
|||
<span t-esc="mi.copy_name" style="font-size: 20px;"/> |
|||
</div> |
|||
|
|||
</t> |
|||
</t> |
|||
|
|||
|
|||
<div t-if="report_type == 'pdf'"> |
|||
Page: <span class="page"/> / <span class="topage"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</template> |
|||
|
|||
<template id="base_accounting_kit.clean"> |
|||
<div t-attf-class="header o_company_#{company.id}_layout" t-att-style="report_header_style"> |
|||
<div class="o_clean_header"> |
|||
<div class="row"> |
|||
<div class="col-6"> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" alt="Logo"/> |
|||
<!--Header--> |
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'header'"> |
|||
<div t-if="txt_align == 'left'"> |
|||
<br/> |
|||
<span t-esc="mi.copy_name" style="font-size: 20px; padding-left:25px; white-space:nowrap;"/> |
|||
</div> |
|||
<div t-if="txt_align == 'center'" class="text-align: center"> |
|||
<br/> |
|||
<span t-esc="mi.copy_name" style="font-size: 20px; |
|||
margin-left:280px; margin-right:280px; white-space:nowrap;"/> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</div> |
|||
<div class="col-5 offset-1" name="company_address"> |
|||
<ul class="list-unstyled"> |
|||
<strong><li t-if="company.name"><span t-field="company.name"/></li></strong> |
|||
<li t-if="company.vat"><t t-esc="company.country_id.vat_label or 'Tax ID'"/>: <span t-field="company.vat"/></li> |
|||
<li t-if="company.phone">Tel: <span class="o_force_ltr" t-field="company.phone"/></li> |
|||
<li t-if="company.email"><span t-field="company.email"/></li> |
|||
<li t-if="company.website"><span t-field="company.website"/></li> |
|||
<!--Header--> |
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'header'"> |
|||
<div t-if="txt_align == 'right'"> |
|||
<span t-esc="mi.copy_name" style="font-size: 20px;"/> |
|||
</div> |
|||
|
|||
</t> |
|||
</t> |
|||
|
|||
</ul> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!--Watermark--> |
|||
<t t-if="mi_type =='watermark'"> |
|||
<div style="opacity:0.15; font-size:100px; width:85%; text-align:center;top:500px; right:100px; position: fixed; z-index:99; -webkit-transform: rotate(-30deg);"> |
|||
<t t-esc="mi.copy_name"/> |
|||
</div> |
|||
</t> |
|||
</div> |
|||
|
|||
<div t-attf-class="article o_report_layout_clean o_company_#{company.id}_layout" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')"> |
|||
<t t-call="web.address_layout"/> |
|||
<t t-raw="0"/> |
|||
</div> |
|||
|
|||
<div t-attf-class="footer o_clean_footer o_company_#{company.id}_layout"> |
|||
<div class="row mt8"> |
|||
<!--Footer--> |
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'footer'"> |
|||
<div t-if="txt_align == 'left'" class="text-left"> |
|||
<span t-esc="mi.copy_name" style="font-size: 18px; padding-left:25px; white-space:nowrap;"/> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
<div class="col-3"> |
|||
<span t-field="company.report_footer"/> |
|||
</div> |
|||
|
|||
<div class="col-4 text-right"> |
|||
<span class="company_address" t-field="company.partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address"], "no_marker": true}'/> |
|||
</div> |
|||
<div class="col-4"> |
|||
<h4 class="mt0 mb0 text-uppercase" t-field="company.report_header"/> |
|||
<!--Footer--> |
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'footer'"> |
|||
<div t-if="txt_align == 'right'" class="text-right"> |
|||
<span t-esc="mi.copy_name" style="font-size: 18px;"/> |
|||
</div> |
|||
|
|||
<div t-if="txt_align == 'center'" class="text-center;"> |
|||
<span t-esc="mi.copy_name" style="font-size: 18px;"/> |
|||
</div> |
|||
|
|||
</t> |
|||
</t> |
|||
|
|||
</div> |
|||
|
|||
<div class="col-1"> |
|||
<ul t-if="report_type == 'pdf'" class="list-inline pagenumber float-right text-center"> |
|||
<li class="list-inline-item"><strong><span class="page"/></strong></li> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<template id="base_accounting_kit.background"> |
|||
<div t-attf-class="o_company_#{company.id}_layout header" t-att-style="report_header_style"> |
|||
<div class="o_background_header"> |
|||
<div class="float-right"> |
|||
<h3 class="mt0 text-right" t-field="company.report_header"/> |
|||
</div> |
|||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" class="float-left" alt="Logo"/> |
|||
<div class="float-left company_address"> |
|||
<div> |
|||
<strong t-field="company.partner_id.name"/> |
|||
</div> |
|||
<span t-field="company.partner_id" |
|||
t-options='{"widget": "contact", "fields": ["address"], "no_marker": true}'/> |
|||
</div> |
|||
|
|||
<!--Header--> |
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'header'"> |
|||
<div t-if="txt_align == 'right'" class="text-right" style="position: relative; top: 50px;"> |
|||
<span t-esc="mi.copy_name" style="font-size: 20px;"/> |
|||
</div> |
|||
<div t-if="txt_align == 'center'" class="text-center"> |
|||
<br/> |
|||
<span t-esc="mi.copy_name" style="font-size: 20px; |
|||
margin-left:280px; margin-right:280px; white-space:nowrap;"/> |
|||
</div> |
|||
<div t-if="txt_align == 'left'" class="text-left" style="position: fixed; top: 70px; left:20px;"> |
|||
<br/> |
|||
<span t-esc="mi.copy_name" style="font-size: 20px; white-space:nowrap;"/> |
|||
</div> |
|||
|
|||
</t> |
|||
</t> |
|||
|
|||
<div class="clearfix mb8"/> |
|||
</div> |
|||
<!--Watermark--> |
|||
<t t-if="mi_type =='watermark'"> |
|||
<div style="opacity:0.15; font-size:100px; width:85%; text-align:center;top:500px; right:100px; position: fixed; z-index:99; -webkit-transform: rotate(-30deg);"> |
|||
<t t-esc="mi.copy_name"/> |
|||
</div> |
|||
</t> |
|||
</div> |
|||
|
|||
<div t-attf-class="o_company_#{company.id}_layout article o_report_layout_background" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')"> |
|||
<t t-call="web.address_layout"/> |
|||
<t t-raw="0"/> |
|||
</div> |
|||
|
|||
<div t-attf-class="o_company_#{company.id}_layout footer o_background_footer"> |
|||
<div class="text-center"> |
|||
<ul class="list-inline"> |
|||
<li t-if="company.phone" class="list-inline-item"><i class="fa fa-phone" role="img" aria-label="Phone" title="Phone"/> <span class="o_force_ltr" t-field="company.phone"/></li> |
|||
<li t-if="company.email" class="list-inline-item"><i class="fa fa-at" role="img" aria-label="Email" title="Email"/> <span t-field="company.email"/></li> |
|||
<li t-if="company.website" class="list-inline-item"><i class="fa fa-globe" role="img" aria-label="Website" title="Website"/> <span t-field="company.website"/></li> |
|||
<li t-if="company.vat" class="list-inline-item"><i class="fa fa-building-o" role="img" aria-label="Fiscal number"/><t t-esc="company.country_id.vat_label or 'Tax ID'"/>: <span t-field="company.vat"/></li> |
|||
</ul> |
|||
<div t-field="company.report_footer"/> |
|||
|
|||
<!--Footer--> |
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'footer'"> |
|||
<div t-if="txt_align == 'right'" class="text-right"> |
|||
<span t-esc="mi.copy_name" style="font-size: 15px;"/> |
|||
</div> |
|||
<div t-if="txt_align == 'left'" class="text-left"> |
|||
<span t-esc="mi.copy_name" style="font-size: 15px;"/> |
|||
</div> |
|||
<div t-if="txt_align == 'center'" class="text-center;"> |
|||
<span t-esc="mi.copy_name" style="font-size: 15px;"/> |
|||
</div> |
|||
|
|||
</t> |
|||
</t> |
|||
<div t-if="report_type == 'pdf'" class="text-muted"> |
|||
Page: |
|||
<span class="page"/> |
|||
of |
|||
<span class="topage"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
|
|||
<template id="multiple_invoice_wizard_preview"> |
|||
<t t-call="web.html_preview_container"> |
|||
<t t-call="base_accounting_kit.new_external_layout"> |
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'body'"> |
|||
<div t-if="body_txt_position == 'tr'" style="font-size:25px; text-align:right;"> |
|||
<span>Sample Name</span> |
|||
</div> |
|||
<div t-if="body_txt_position == 'tl'" style="font-size:25px; text-align:left;"> |
|||
<span>Sample Name</span> |
|||
</div> |
|||
|
|||
</t> |
|||
</t> |
|||
<div class="pt-5"> |
|||
<div class="address row"> |
|||
<div name="address" class="col-md-5 ml-auto"> |
|||
<address> |
|||
<address class="mb-0" itemscope="itemscope" |
|||
itemtype="http://schema.org/Organization"> |
|||
<div> |
|||
<span itemprop="name">Deco Addict</span> |
|||
</div> |
|||
<div itemprop="address" itemscope="itemscope" |
|||
itemtype="http://schema.org/PostalAddress"> |
|||
<div class="d-flex align-items-baseline"> |
|||
<span class="w-100 o_force_ltr" itemprop="streetAddress">77 Santa Barbara |
|||
Rd<br/>Pleasant Hill CA 94523<br/>United States</span> |
|||
</div> |
|||
</div> |
|||
</address> |
|||
</address> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="page"> |
|||
<h2> |
|||
<span>Invoice</span> |
|||
<span>INV/2020/07/0003</span> |
|||
</h2> |
|||
<div id="informations" class="row mt32 mb32"> |
|||
<div class="col-auto mw-100 mb-2" name="invoice_date"> |
|||
<strong>Invoice Date:</strong> |
|||
<p class="m-0">07/08/2020</p> |
|||
</div> |
|||
<div class="col-auto mw-100 mb-2" name="due_date"> |
|||
<strong>Due Date:</strong> |
|||
<p class="m-0">08/07/2020</p> |
|||
</div> |
|||
</div> |
|||
<table class="table table-sm o_main_table" name="invoice_line_table"> |
|||
<thead> |
|||
<tr> |
|||
<th name="th_description" class="text-left"><span>Description</span></th> |
|||
<th name="th_quantity" class="text-right"><span>Quantity</span></th> |
|||
<th name="th_priceunit" class="text-right d-none d-md-table-cell"><span>Unit Price</span></th> |
|||
<th name="th_taxes" class="text-left d-none d-md-table-cell"><span>Taxes</span></th> |
|||
<th name="th_subtotal" class="text-right"> |
|||
<span>Amount</span> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="invoice_tbody"> |
|||
<tr> |
|||
<td name="account_invoice_line_name"><span>[FURN_8999] Three-Seat Sofa<br/> |
|||
Three Seater Sofa with Lounger in Steel Grey Colour</span></td> |
|||
<td class="text-right"> |
|||
<span>5.000</span> |
|||
</td> |
|||
<td class="text-right d-none d-md-table-cell"> |
|||
<span class="text-nowrap">1,500.00</span> |
|||
</td> |
|||
<td class="text-left d-none d-md-table-cell"> |
|||
<span id="line_tax_ids">15.00%</span> |
|||
</td> |
|||
<td class="text-right o_price_total"> |
|||
<span class="text-nowrap">$ <span class="oe_currency_value">7,500.00</span></span> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td name="account_invoice_line_name"><span>[FURN_8220] Four Person Desk<br/> |
|||
Four person modern office workstation</span></td> |
|||
<td class="text-right"> |
|||
<span>5.000</span> |
|||
</td> |
|||
<td class="text-right d-none d-md-table-cell"> |
|||
<span class="text-nowrap">23,500.00</span> |
|||
</td> |
|||
<td class="text-left d-none d-md-table-cell"> |
|||
<span id="line_tax_ids">15.00%</span> |
|||
</td> |
|||
<td class="text-right o_price_total"> |
|||
<span class="text-nowrap">$ <span class="oe_currency_value">117,500.00</span></span> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<div class="clearfix"> |
|||
<div id="total" class="row"> |
|||
<div class="col-sm-7 col-md-6 ml-auto"> |
|||
<table class="table table-sm" style="page-break-inside: avoid;"> |
|||
<tbody><tr class="border-black o_subtotal" style=""> |
|||
<td><strong>Subtotal</strong></td> |
|||
<td class="text-right"> |
|||
<span>$ <span class="oe_currency_value">125,000.00</span></span> |
|||
</td> |
|||
</tr> |
|||
<tr style=""> |
|||
<td><span class="text-nowrap">Tax 15%</span></td> |
|||
<td class="text-right o_price_total"> |
|||
<span class="text-nowrap">$ 18,750.00</span> |
|||
</td> |
|||
</tr> |
|||
<tr class="border-black o_total"> |
|||
<td><strong>Total</strong></td> |
|||
<td class="text-right"> |
|||
<span class="text-nowrap">$ <span class="oe_currency_value"> |
|||
143,750.00</span></span> |
|||
</td> |
|||
</tr> |
|||
</tbody></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<p> |
|||
Please use the following communication for your payment : <b><span> |
|||
INV/2020/07/0003</span></b> |
|||
</p> |
|||
<p name="payment_term"> |
|||
<span>Payment terms: 300 Days</span> |
|||
</p> |
|||
|
|||
<t t-if="mi_type == 'text'"> |
|||
<t t-if="txt_position == 'body'"> |
|||
<div t-if="body_txt_position == 'br'" style="font-size:25px; text-align:right;"> |
|||
<span>Sample Name</span> |
|||
</div> |
|||
<div t-if="body_txt_position == 'bl'" style="font-size:25px; text-align:left;"> |
|||
<span>Sample Name</span> |
|||
</div> |
|||
|
|||
</t> |
|||
</t> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
|
|||
<template id="new_external_layout"> |
|||
<t t-if="not o" t-set="o" t-value="doc"/> |
|||
|
|||
<t t-if="not company"> |
|||
<!-- Multicompany --> |
|||
<t t-if="company_id"> |
|||
<t t-set="company" t-value="company_id"/> |
|||
</t> |
|||
<t t-elif="o and 'company_id' in o"> |
|||
<t t-set="company" t-value="o.company_id.sudo()"/> |
|||
</t> |
|||
<t t-else="else"> |
|||
<t t-set="company" t-value="res_company"/> |
|||
</t> |
|||
</t> |
|||
|
|||
<t t-if="layout" t-call="{{layout}}"><t t-raw="0"/></t> |
|||
<t t-else="else" t-call="base_accounting_kit.standard"><t t-raw="0"/></t> |
|||
|
|||
</template> |
|||
|
|||
</odoo> |
@ -0,0 +1,37 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from odoo import models, api |
|||
|
|||
|
|||
class ReportInvoiceMultiple(models.AbstractModel): |
|||
_name = 'report.base_accounting_kit.report_multiple_invoice' |
|||
_inherit = 'report.account.report_invoice' |
|||
|
|||
@api.model |
|||
def _get_report_values(self, docids, data=None): |
|||
rslt = super()._get_report_values(docids, data) |
|||
|
|||
inv = rslt['docs'] |
|||
layout = inv.journal_id.company_id.external_report_layout_id.key |
|||
|
|||
if layout == 'web.external_layout_boxed': |
|||
new_layout = 'base_accounting_kit.boxed' |
|||
|
|||
elif layout == 'web.external_layout_clean': |
|||
new_layout = 'base_accounting_kit.clean' |
|||
|
|||
elif layout == 'web.external_layout_background': |
|||
new_layout = 'base_accounting_kit.background' |
|||
|
|||
else: |
|||
new_layout = 'base_accounting_kit.standard' |
|||
|
|||
rslt['mi_type'] = inv.journal_id.multiple_invoice_type |
|||
rslt['mi_ids'] = inv.journal_id.multiple_invoice_ids |
|||
rslt['txt_position'] = inv.journal_id.text_position |
|||
rslt['body_txt_position'] = inv.journal_id.body_text_position |
|||
rslt['txt_align'] = inv.journal_id.text_align |
|||
rslt['layout'] = new_layout |
|||
|
|||
rslt['report_type'] = data.get('report_type') if data else '' |
|||
return rslt |
@ -0,0 +1,260 @@ |
|||
<odoo> |
|||
|
|||
<template id="report_multiple_invoice_new"> |
|||
|
|||
<t t-call="base_accounting_kit.new_external_layout"> |
|||
<t t-set="o" t-value="o.with_context(lang=lang)" /> |
|||
|
|||
<t t-set="address"> |
|||
<address t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' /> |
|||
<div t-if="o.partner_id.vat" class="mt16"> |
|||
<t t-if="o.company_id.country_id.vat_label" t-esc="o.company_id.country_id.vat_label" id="inv_tax_id_label"/> |
|||
<t t-else="">Tax ID</t>: <span t-field="o.partner_id.vat"/></div> |
|||
</t> |
|||
<div class="page"> |
|||
|
|||
<t t-set="txt_style" t-value="'font-size:25px; text-align:center;top:0px; left:15px; position:absolute; z-index:99;'"/> |
|||
<t t-if="body_txt_position == 'tr'"> |
|||
<t t-set="txt_style" t-value="'font-size:25px; text-align:center;top:0px; right:15px; position:absolute; z-index:99;'"/> |
|||
</t> |
|||
<t t-if="body_txt_position == 'br'"> |
|||
<t t-set="txt_style" t-value="'font-size:25px; text-align:right;'"/> |
|||
</t> |
|||
<t t-if="body_txt_position == 'bl'"> |
|||
<t t-set="txt_style" t-value="'font-size:25px; text-align:left;'"/> |
|||
</t> |
|||
|
|||
<h2> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'posted'">Invoice</span> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span> |
|||
<span t-if="o.move_type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span> |
|||
<span t-if="o.move_type == 'out_refund'">Credit Note</span> |
|||
<span t-if="o.move_type == 'in_refund'">Vendor Credit Note</span> |
|||
<span t-if="o.move_type == 'in_invoice'">Vendor Bill</span> |
|||
<span t-if="o.name != '/'" t-field="o.name"/> |
|||
</h2> |
|||
|
|||
<div id="informations" class="row mt32 mb32"> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_date" name="invoice_date"> |
|||
<strong>Invoice Date:</strong> |
|||
<p class="m-0" t-field="o.invoice_date"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_date_due and o.move_type == 'out_invoice' and o.state == 'posted'" name="due_date"> |
|||
<strong>Due Date:</strong> |
|||
<p class="m-0" t-field="o.invoice_date_due"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_origin" name="origin"> |
|||
<strong>Source:</strong> |
|||
<p class="m-0" t-field="o.invoice_origin"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.partner_id.ref" name="customer_code"> |
|||
<strong>Customer Code:</strong> |
|||
<p class="m-0" t-field="o.partner_id.ref"/> |
|||
</div> |
|||
<div class="col-auto col-3 mw-100 mb-2" t-if="o.ref" name="reference"> |
|||
<strong>Reference:</strong> |
|||
<p class="m-0" t-field="o.ref"/> |
|||
</div> |
|||
</div> |
|||
|
|||
<t t-set="display_discount" t-value="any(l.discount for l in o.invoice_line_ids)"/> |
|||
|
|||
<table class="table table-sm o_main_table" name="invoice_line_table"> |
|||
<thead> |
|||
<tr> |
|||
<th name="th_description" class="text-left"><span>Description</span></th> |
|||
<th name="th_quantity" class="text-right"><span>Quantity</span></th> |
|||
<th name="th_priceunit" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"><span>Unit Price</span></th> |
|||
<th name="th_price_unit" t-if="display_discount" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span>Disc.%</span> |
|||
</th> |
|||
<th name="th_taxes" t-attf-class="text-left {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"><span>Taxes</span></th> |
|||
<th name="th_subtotal" class="text-right"> |
|||
<span groups="account.group_show_line_subtotals_tax_excluded">Amount</span> |
|||
<span groups="account.group_show_line_subtotals_tax_included">Total Price</span> |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody class="invoice_tbody"> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
<t t-set="lines" t-value="o.invoice_line_ids.sorted(key=lambda l: (-l.sequence, l.date, l.move_name, -l.id), reverse=True)"/> |
|||
|
|||
<t t-foreach="lines" t-as="line"> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/> |
|||
|
|||
<tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''"> |
|||
<t t-if="not line.display_type" name="account_invoice_line_accountable"> |
|||
<td name="account_invoice_line_name"><span t-field="line.name" t-options="{'widget': 'text'}"/></td> |
|||
<td class="text-right"> |
|||
<span t-field="line.quantity"/> |
|||
<span t-field="line.product_uom_id" groups="uom.group_uom"/> |
|||
</td> |
|||
<td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span class="text-nowrap" t-field="line.price_unit"/> |
|||
</td> |
|||
<td t-if="display_discount" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span class="text-nowrap" t-field="line.discount"/> |
|||
</td> |
|||
<td t-attf-class="text-left {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"> |
|||
<span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))" id="line_tax_ids"/> |
|||
</td> |
|||
<td class="text-right o_price_total"> |
|||
<span class="text-nowrap" t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/> |
|||
<span class="text-nowrap" t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/> |
|||
</td> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_section'"> |
|||
<td colspan="99"> |
|||
<span t-field="line.name" t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
<t t-set="current_section" t-value="line"/> |
|||
<t t-set="current_subtotal" t-value="0"/> |
|||
</t> |
|||
<t t-if="line.display_type == 'line_note'"> |
|||
<td colspan="99"> |
|||
<span t-field="line.name" t-options="{'widget': 'text'}"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
|
|||
<t t-if="current_section and (line_last or lines[line_index+1].display_type == 'line_section')"> |
|||
<tr class="is-subtotal text-right"> |
|||
<td colspan="99"> |
|||
<strong class="mr16">Subtotal</strong> |
|||
<span |
|||
t-esc="current_subtotal" |
|||
t-options='{"widget": "monetary", "display_currency": o.currency_id}' |
|||
/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
|
|||
<div class="clearfix"> |
|||
<div id="total" class="row"> |
|||
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ml-auto"> |
|||
<table class="table table-sm" style="page-break-inside: avoid;"> |
|||
<tr class="border-black o_subtotal" style=""> |
|||
<td><strong>Subtotal</strong></td> |
|||
<td class="text-right"> |
|||
<span t-field="o.amount_untaxed"/> |
|||
</td> |
|||
</tr> |
|||
<t t-foreach="o.amount_by_group" t-as="amount_by_group"> |
|||
<tr style=""> |
|||
<t t-if="len(o.line_ids.filtered(lambda line: line.tax_line_id)) in [0, 1] and o.amount_untaxed == amount_by_group[2]"> |
|||
<td><span class="text-nowrap" t-esc="amount_by_group[0]"/></td> |
|||
<td class="text-right o_price_total"> |
|||
<span class="text-nowrap" t-esc="amount_by_group[3]" /> |
|||
</td> |
|||
</t> |
|||
<t t-else=""> |
|||
<td> |
|||
<span t-esc="amount_by_group[0]"/> |
|||
<span class="text-nowrap"> on |
|||
<t t-esc="amount_by_group[4]"/> |
|||
</span> |
|||
</td> |
|||
<td class="text-right o_price_total"> |
|||
<span class="text-nowrap" t-esc="amount_by_group[3]"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
</t> |
|||
<tr class="border-black o_total"> |
|||
<td><strong>Total</strong></td> |
|||
<td class="text-right"> |
|||
<span class="text-nowrap" t-field="o.amount_total"/> |
|||
</td> |
|||
</tr> |
|||
<t t-if="print_with_payments"> |
|||
<t t-if="o.payment_state != 'invoicing_legacy'"> |
|||
<t t-set="payments_vals" t-value="o.sudo()._get_reconciled_info_JSON_values()"/> |
|||
<t t-foreach="payments_vals" t-as="payment_vals"> |
|||
<tr> |
|||
<td> |
|||
<i class="oe_form_field text-right oe_payment_label">Paid on <t t-esc="payment_vals['date']" t-options='{"widget": "date"}'/></i> |
|||
</td> |
|||
<td class="text-right"> |
|||
<span t-esc="payment_vals['amount']" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
<t t-if="len(payments_vals) > 0"> |
|||
<tr class="border-black"> |
|||
<td><strong>Amount Due</strong></td> |
|||
<td class="text-right"> |
|||
<span t-field="o.amount_residual"/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<p t-if="o.move_type in ('out_invoice', 'in_refund') and o.payment_reference" name="payment_communication"> |
|||
Please use the following communication for your payment : <b><span t-field="o.payment_reference"/></b> |
|||
</p> |
|||
|
|||
<p t-if="o.invoice_payment_term_id" name="payment_term"> |
|||
<span t-field="o.invoice_payment_term_id.note"/> |
|||
</p> |
|||
|
|||
<p t-if="o.narration" name="comment"> |
|||
<span t-field="o.narration"/> |
|||
</p> |
|||
<p t-if="o.fiscal_position_id.note" name="note"> |
|||
<span t-field="o.fiscal_position_id.note"/> |
|||
</p> |
|||
<p t-if="o.invoice_incoterm_id" name="incoterm"> |
|||
<strong>Incoterm: </strong><span t-field="o.invoice_incoterm_id.code"/> - <span t-field="o.invoice_incoterm_id.name"/> |
|||
</p> |
|||
<div id="qrcode" t-if="o.display_qr_code"> |
|||
<p t-if="qr_code_urls.get(o.id)"> |
|||
<strong class="text-center">Scan me with your banking app.</strong><br/><br/> |
|||
<img class="border border-dark rounded" t-att-src="qr_code_urls[o.id]"/> |
|||
</p> |
|||
</div> |
|||
|
|||
<t t-if="mi_type == 'text'"> |
|||
<div t-if="txt_position == 'body'" t-att-style="txt_style"> |
|||
<span t-esc="mi.copy_name" /> |
|||
</div> |
|||
</t> |
|||
|
|||
</div> |
|||
</t> |
|||
</template> |
|||
|
|||
<template id="report_multiple_invoice"> |
|||
<t t-call="web.html_container"> |
|||
<t t-foreach="docs" t-as="o"> |
|||
<t t-set="lang" t-value="o.invoice_user_id.sudo().lang if o.move_type in ('in_invoice', 'in_refund') else o.partner_id.lang"/> |
|||
<t t-set="print_with_payments" t-value="True"/> |
|||
<t t-if="o._get_name_invoice_report() == 'account.report_invoice_document'" |
|||
t-call="account.report_invoice_document" t-lang="lang"/> |
|||
<t t-foreach="mi_ids" t-as="mi"> |
|||
<t t-call="base_accounting_kit.report_multiple_invoice_new" t-lang="lang"/> |
|||
</t> |
|||
|
|||
</t> |
|||
</t> |
|||
</template> |
|||
|
|||
|
|||
<record id="report_multiple_invoice_copies" model="ir.actions.report"> |
|||
<field name="name">Multiple Invoice Copies</field> |
|||
<field name="model">account.move</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">base_accounting_kit.report_multiple_invoice</field> |
|||
<field name="report_file">base_accounting_kit.report_multiple_invoice</field> |
|||
<field name="binding_model_id" ref="account.model_account_move"/> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
|
|||
</odoo> |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 122 KiB |
After Width: | Height: | Size: 179 KiB |
After Width: | Height: | Size: 186 KiB |
After Width: | Height: | Size: 229 KiB |
After Width: | Height: | Size: 117 KiB |
After Width: | Height: | Size: 105 KiB |
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 34 KiB |
@ -0,0 +1,33 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<odoo> |
|||
<record id="multiple_invoice_view_form" model="ir.ui.view"> |
|||
<field name="name">multiple.invoice.form.inherit.account.journal</field> |
|||
<field name="model">account.journal</field> |
|||
<field name="inherit_id" ref="account.view_account_journal_form" /> |
|||
<field name="arch" type="xml"> |
|||
<page name="advanced_settings" position="inside"> |
|||
|
|||
<group string="Multiple Invoice Copies" attrs="{'invisible': [('type', 'not in',['sale', 'purchase'])]}"> |
|||
<field name="multiple_invoice_type" style="width: 40%"/> |
|||
|
|||
</group> |
|||
<group attrs="{'invisible': [('type', 'not in',['sale', 'purchase'])]}"> |
|||
<div class="mt8"> |
|||
<button name="%(base_accounting_kit.action_multiple_invoice_layout_configurator)d" string="Configure Copy Layout" type="action" class="oe_link" icon="fa-arrow-right"/> |
|||
</div> |
|||
</group> |
|||
|
|||
<group attrs="{'invisible': [('type', 'not in',['sale', 'purchase'])]}"> |
|||
<div> |
|||
<field name="multiple_invoice_ids" widget="one2many" nolabel="1"> |
|||
<tree editable="bottom"> |
|||
<field name="sequence" widget="handle"/> |
|||
<field name="copy_name" style="width: 75"/> |
|||
</tree> |
|||
</field> |
|||
</div> |
|||
</group> |
|||
</page> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,44 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<record id="view_multiple_invoice_layout" model="ir.ui.view"> |
|||
<field name="name">Document Layout</field> |
|||
<field name="model">multiple.invoice.layout</field> |
|||
<field name="arch" type="xml"> |
|||
<form class="o_document_layout"> |
|||
<group> |
|||
<group class="o_document_layout_company"> |
|||
<field name="company_id" invisible="1"/> |
|||
<field name="journal_id" invisible="1"/> |
|||
<field name="multiple_invoice_type"/> |
|||
<field name="text_position" widget="selection" |
|||
attrs="{'invisible': [('multiple_invoice_type', '!=', 'text')]}"/> |
|||
<field name="body_text_position" widget="radio" |
|||
attrs="{'invisible': ['|', ('multiple_invoice_type', '!=', 'text'), |
|||
('text_position', '!=', 'body')]}"/> |
|||
<field name="text_align" widget="radio" string="Text Align" |
|||
attrs="{'invisible': ['|', ('multiple_invoice_type', '!=', 'text'), |
|||
('text_position', 'not in', ['header', 'footer'])]}"/> |
|||
</group> |
|||
<div> |
|||
<field name="preview" widget="iframe_wrapper" /> |
|||
</div> |
|||
</group> |
|||
<footer> |
|||
<button string="Save" class="btn-primary" type="object" name="document_layout_save"/> |
|||
<button special="cancel" string="Cancel" /> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_multiple_invoice_layout_configurator" model="ir.actions.act_window"> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="name">Configure Copy layout</field> |
|||
<field name="view_mode">form</field> |
|||
<field name="target">new</field> |
|||
<field name="res_model">multiple.invoice.layout</field> |
|||
<field name="view_id" ref="base_accounting_kit.view_multiple_invoice_layout"/> |
|||
</record> |
|||
|
|||
</odoo> |
|||
|