mirror of
https://gitlab.com/flectra-hq/flectra.git
synced 2026-10-25 23:40:05 -05:00
[PATCH] Upstream patch - 18032022
This commit is contained in:
1 parent
2cd920feec
commit
68e5980232
6 files changed
+28
-6
No files matched your search
@@ -1 +1,6 @@
|
||||
from . import models
|
||||
from flectra import api, SUPERUSER_ID
|
||||
|
||||
def _create_demo_config_param(cr, registry):
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
env['ir.config_parameter'].set_param('account_edi_proxy_client.demo', 'demo')
|
||||
@@ -17,9 +17,9 @@ Flectra database.
|
||||
},
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'data/config_demo.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'license': 'LGPL-3',
|
||||
'post_init_hook': '_create_demo_config_param',
|
||||
}
|
||||
@@ -37,6 +37,11 @@ class SaleOrder(models.Model):
|
||||
if delivery_line:
|
||||
self.recompute_delivery_price = True
|
||||
|
||||
def _get_update_prices_lines(self):
|
||||
""" Exclude delivery lines from price list recomputation based on product instead of carrier """
|
||||
lines = super()._get_update_prices_lines()
|
||||
return lines.filtered(lambda line: not line.is_delivery)
|
||||
|
||||
def _remove_delivery_line(self):
|
||||
delivery_lines = self.env['sale.order.line'].search([('order_id', 'in', self.ids), ('is_delivery', '=', True)])
|
||||
if not delivery_lines:
|
||||
|
||||
@@ -239,6 +239,14 @@ class AccountMove(models.Model):
|
||||
return self._get_formatted_sequence()
|
||||
return super()._get_starting_sequence()
|
||||
|
||||
def _get_last_sequence(self, relaxed=False):
|
||||
""" If use share sequences we need to recompute the sequence to add the proper document code prefix """
|
||||
res = super()._get_last_sequence(relaxed=relaxed)
|
||||
if res and self.journal_id.l10n_ar_share_sequences and self.l10n_latam_document_type_id.doc_code_prefix not in res:
|
||||
res = self._get_formatted_sequence(number=self._l10n_ar_get_document_number_parts(
|
||||
res.split()[-1], self.l10n_latam_document_type_id.code)['invoice_number'])
|
||||
return res
|
||||
|
||||
def _get_last_sequence_domain(self, relaxed=False):
|
||||
where_string, param = super(AccountMove, self)._get_last_sequence_domain(relaxed)
|
||||
if self.company_id.country_id.code == "AR" and self.l10n_latam_use_documents:
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</Descrizione>
|
||||
<Quantita t-esc="format_numbers(line.quantity)"/>
|
||||
<UnitaMisura t-if="line.product_uom_id.category_id != env.ref('uom.product_uom_categ_unit')" t-esc="line.product_uom_id.name"/>
|
||||
<PrezzoUnitario t-esc="'%.06f' % (line.price_subtotal / (( 1 - (line.discount or 0.0) / 100.0) * line.quantity))"/>
|
||||
<PrezzoUnitario t-esc="'%.06f' % (line.price_subtotal / (( 1 - (line.discount or 0.0) / 100.0) * line.quantity) if line.discount != 100.0 else line.price_unit)"/>
|
||||
<ScontoMaggiorazione t-if="line.discount != 0">
|
||||
<!-- [2.2.1.10] -->
|
||||
<Tipo t-esc="discount_type(line.discount)"/>
|
||||
@@ -52,7 +52,7 @@
|
||||
<DatiTrasmissione>
|
||||
<IdTrasmittente>
|
||||
<IdPaese t-esc="get_vat_country(record.company_id.vat)"/>
|
||||
<IdCodice t-esc="get_vat_number(record.company_id.vat)"/>
|
||||
<IdCodice t-esc="record.company_id.l10n_it_codice_fiscale or get_vat_number(record.company_id.vat)"/>
|
||||
</IdTrasmittente>
|
||||
<ProgressivoInvio t-esc="record.name.replace('/','')[-10:]"/>
|
||||
<FormatoTrasmissione t-esc="formato_trasmissione"/>
|
||||
@@ -72,7 +72,7 @@
|
||||
<IdPaese t-esc="get_vat_country(record.company_id.vat)"/>
|
||||
<IdCodice t-esc="get_vat_number(record.company_id.vat)"/>
|
||||
</IdFiscaleIVA>
|
||||
<CodiceFiscale t-if="record.company_id.l10n_it_codice_fiscale and not test_mode" t-esc="record.company_id.l10n_it_codice_fiscale"/>
|
||||
<CodiceFiscale t-if="record.company_id.l10n_it_codice_fiscale" t-esc="record.company_id.l10n_it_codice_fiscale"/>
|
||||
<Anagrafica>
|
||||
<Denominazione t-esc="record.company_id.partner_id.display_name"/>
|
||||
</Anagrafica>
|
||||
@@ -147,7 +147,7 @@
|
||||
</DatiBollo>
|
||||
</DatiGeneraliDocumento>
|
||||
<DatiOrdineAcquisto t-if="record.ref">
|
||||
<IdDocumento t-esc="record.ref" />
|
||||
<IdDocumento t-esc="record.ref[:20]" />
|
||||
</DatiOrdineAcquisto>
|
||||
<DatiDDT t-if="record.l10n_it_ddt_id">
|
||||
<!--2.1.8-->
|
||||
|
||||
@@ -471,10 +471,14 @@ class SaleOrder(models.Model):
|
||||
else:
|
||||
self.show_update_pricelist = False
|
||||
|
||||
def _get_update_prices_lines(self):
|
||||
""" Hook to exclude specific lines which should not be updated based on price list recomputation """
|
||||
return self.order_line.filtered(lambda line: not line.display_type)
|
||||
|
||||
def update_prices(self):
|
||||
self.ensure_one()
|
||||
lines_to_update = []
|
||||
for line in self.order_line.filtered(lambda line: not line.display_type):
|
||||
for line in self._get_update_prices_lines():
|
||||
product = line.product_id.with_context(
|
||||
partner=self.partner_id,
|
||||
quantity=line.product_uom_qty,
|
||||
|
||||
Reference in new issue
Block a user