mirror of
https://github.com/bringout/oca-ocb-l10n_americas.git
synced 2026-04-27 03:12:08 +02:00
19.0 vanilla
This commit is contained in:
parent
89c6e82fe7
commit
1b82c20a58
572 changed files with 43570 additions and 53303 deletions
|
|
@ -1,9 +1,9 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import models, fields
|
||||
from odoo.tools import SQL
|
||||
|
||||
|
||||
class AccountInvoiceReport(models.Model):
|
||||
|
||||
_inherit = 'account.invoice.report'
|
||||
|
||||
l10n_ar_state_id = fields.Many2one('res.country.state', 'Delivery Province', readonly=True)
|
||||
|
|
@ -14,8 +14,10 @@ class AccountInvoiceReport(models.Model):
|
|||
'res.partner': ['state_id'],
|
||||
}
|
||||
|
||||
def _select(self):
|
||||
return super()._select() + ", contact_partner.state_id as l10n_ar_state_id, move.date"
|
||||
def _select(self) -> SQL:
|
||||
return SQL("%s, contact_partner.state_id as l10n_ar_state_id, move.date",
|
||||
super()._select())
|
||||
|
||||
def _from(self):
|
||||
return super()._from() + " LEFT JOIN res_partner contact_partner ON contact_partner.id = COALESCE(move.partner_shipping_id, move.partner_id)"
|
||||
def _from(self) -> SQL:
|
||||
return SQL("%s LEFT JOIN res_partner contact_partner ON contact_partner.id = COALESCE(move.partner_shipping_id, move.partner_id)",
|
||||
super()._from())
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<search>
|
||||
<field name="l10n_ar_state_id"/>
|
||||
<filter name="with_document" string="With Document" domain="[('l10n_latam_document_type_id', '!=', False)]"/>
|
||||
<filter name="filter_accounting_date_this_year" invisible="1" string="Accounting Date: This Year" domain="[('date', '<', (context_today() + relativedelta(years=1, month=1, day=1)).strftime('%Y-%m-%d')), ('date', '>=', (context_today() + relativedelta(month=1, day=1)).strftime('%Y-%m-%d'))]"/>
|
||||
<filter name="filter_accounting_date_this_year" invisible="1" string="Accounting Date: This Year" domain="[('date', '<', '=1m =1d +1y'), ('date', '>=', '=1m =1d')]"/>
|
||||
</search>
|
||||
<filter name="user" position="after">
|
||||
<filter string="State" name="groupby_l10n_ar_state_id" context="{'group_by': 'l10n_ar_state_id'}"/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue