[PATCH] Upstream patch - 15092023

This commit is contained in:
Parthiv Patel
2023-09-15 08:34:20 +00:00
parent 5f5e89aab6
commit 044506886b
3 changed files with 6 additions and 4 deletions

View File

@@ -314,7 +314,7 @@ class AccountEdiCommon(models.AbstractModel):
# Normalize the name of the file : some e-fff emitters put the full path of the file
# (Windows or Linux style) and/or the name of the xml instead of the pdf.
# Get only the filename with a pdf extension.
name = attachment_name.text.split('\\')[-1].split('/')[-1].split('.')[0] + '.pdf'
name = (attachment_name.text or 'invoice').split('\\')[-1].split('/')[-1].split('.')[0] + '.pdf'
attachment = self.env['ir.attachment'].create({
'name': name,
'res_id': invoice.id,
@@ -515,7 +515,7 @@ class AccountEdiCommon(models.AbstractModel):
for xpath in xpath_dict['basis_qty']:
basis_quantity_node = tree.find(xpath)
if basis_quantity_node is not None:
basis_qty = float(basis_quantity_node.text)
basis_qty = float(basis_quantity_node.text) or 1
# gross_price_unit (optional)
gross_price_unit = None

View File

@@ -17,10 +17,11 @@ def _l10n_es_edi_post_init(cr, registry):
if all_chart_templates:
tax_templates = env['account.tax.template'].search([
('chart_template_id', 'in', all_chart_templates.ids),
'|', '|',
'|', '|', '|',
('l10n_es_type', '!=', False),
('l10n_es_exempt_reason', '!=', False),
('tax_scope', '!=', False),
('l10n_es_bien_inversion', '!=', False),
])
xml_ids = tax_templates.get_external_id()
for company in companies:
@@ -32,4 +33,5 @@ def _l10n_es_edi_post_init(cr, registry):
'l10n_es_exempt_reason': tax_template.l10n_es_exempt_reason,
'tax_scope': tax_template.tax_scope,
'l10n_es_type': tax_template.l10n_es_type,
'l10n_es_bien_inversion': tax_template.l10n_es_bien_inversion,
})

View File

@@ -241,7 +241,7 @@ class PosOrder(models.Model):
invoice_group = fields.Boolean(related="config_id.module_account", readonly=False)
state = fields.Selection(
[('draft', 'New'), ('cancel', 'Cancelled'), ('paid', 'Paid'), ('done', 'Posted'), ('invoiced', 'Invoiced')],
'Status', readonly=True, copy=False, default='draft')
'Status', readonly=True, copy=False, default='draft', index=True)
account_move = fields.Many2one('account.move', string='Invoice', readonly=True, copy=False, index=True)
picking_ids = fields.One2many('stock.picking', 'pos_order_id')