Skip to content

Commit

Permalink
schema modifications, logic for finding BL numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkhao committed Apr 30, 2024
1 parent 2cdf88b commit 3bae6bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions export_invoice_edi_auchan/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,23 @@ class AccountMove(models.Model):
related="partner_id.is_edi_exportable",
)

def _find_bl_info(self):
"""Find entête "Numéro de BL" and date"""
raise NotImplementedError

def _prepare_export_data(self, idx):
self.ensure_one()
res = []
source_orders = self.line_ids.sale_line_ids.order_id
bl_nbr, bl_date = self._find_bl_info()
# Segment Entete facture
res.append(
ENTSegment(
**{
"invoice": self,
"source_orders": source_orders,
"bl_nbr": bl_nbr,
"bl_date": bl_date,
}
).render()
)
Expand Down
1 change: 0 additions & 1 deletion export_invoice_edi_auchan/schema/invoice_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def get_values(self):
or 0.0,
), # Prix unitaire brut
(1,),
(1,),
(70, self.line.name, {"truncate_silent": True}),
(17, self.line.price_subtotal), # Montant Net Ht de la ligne
]
7 changes: 6 additions & 1 deletion export_invoice_edi_auchan/schema/invoice_taxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,10 @@ def get_values(self):
(3, "TVA"), # Étiquette de segment "TVA"
(5, self.tax_line.tax_line_id.amount or 0.0),
(10, self.tax_line.tax_base_amount or 0.0),
(10, self.tax_line.credit or 0.0),
(
10,
self.tax_line.amount_currency
and abs(self.tax_line.amount_currency)
or 0.0,
),
]

0 comments on commit 3bae6bc

Please sign in to comment.