Skip to content

Commit 53065dc

Browse files
committed
IMP varios
1 parent 5d73a60 commit 53065dc

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

l10n_ar_afipws_fe/models/invoice.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ def _get_barcode(self):
101101
str(self.afip_cae), cae_due])
102102
barcode = barcode + self.verification_digit_modulo10(barcode)
103103
self.afip_barcode = barcode
104+
self.afip_barcode_img = self._make_image_I25(barcode)
104105

106+
@api.model
107+
def _make_image_I25(self, barcode):
105108
"Generate the required barcode Interleaved of 7 image using PIL"
106109
image = False
107110
if barcode:
@@ -117,7 +120,7 @@ def _get_barcode(self):
117120
image = output.getvalue()
118121
image = output.getvalue().encode("base64")
119122
output.close()
120-
self.afip_barcode_img = image
123+
return image
121124

122125
@api.model
123126
def verification_digit_modulo10(self, code):

l10n_ar_invoice/__openerp__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
##############################################################################
2121
{
2222
"name": "Argentina - Facturación y documentos AFIP",
23-
'version': '8.0.0.20.1',
23+
'version': '8.0.0.21.0',
2424
'category': 'Localization/Argentina',
2525
'sequence': 14,
2626
'author': 'ADHOC SA',

l10n_ar_invoice/models/invoice.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ class account_invoice(models.Model):
144144
'Document Type',
145145
readonly=True,
146146
ondelete='restrict',
147-
states={'draft': [('readonly', False)]}
147+
states={'draft': [('readonly', False)]},
148+
copy=False
148149
)
149150
afip_incoterm_id = fields.Many2one(
150151
'afip.incoterm',
@@ -566,6 +567,18 @@ def _check_reference(self):
566567
'Supplier Invoice Number must be unique per Supplier'
567568
' and Company!'))
568569

570+
# no lo usamos al final porque ya hay chequeo en chequeos de la loc
571+
# @api.one
572+
# def check_supplier_invoice_number(self):
573+
# # TODO podemos mejorar esto en la v9 con distintos chequeos del
574+
# # supplier number
575+
# if (
576+
# self.type in ('in_invoice', 'in_refund') and
577+
# self.use_documents and not self.supplier_invoice_number):
578+
# raise Warning(_(
579+
# 'On supplier invoices with a "Use Document" Journal, supplier'
580+
# ' invoice number is mandatory, invoice %s' % self.id))
581+
569582
@api.multi
570583
def check_use_documents(self):
571584
# check invoices has document class but journal require it (we check
@@ -703,6 +716,8 @@ def action_move_create(self):
703716
"""
704717
self.check_use_documents()
705718
self.check_argentinian_invoice_taxes()
719+
# no lo usamos al final porque ya hay chequeo en chequeos de la loc
720+
# self.check_supplier_invoice_number()
706721
return super(account_invoice, self).action_move_create()
707722

708723
@api.multi

l10n_ar_invoice/view/invoice_view.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,12 @@
144144
<field name="internal_number" invisible="1"/>
145145
<field name="use_argentinian_localization" invisible="1"/>
146146
</form>
147-
147+
<!-- no lo hacemos obligatorio desde vista para que, por ejemplo, si queremos correr una operation no nos obligue a poner algo -->
148+
<!--
148149
<field name="supplier_invoice_number" position="attributes">
149150
<attribute name="attrs">{'required':[('use_documents','=',True)]}</attribute>
150151
</field>
151-
152+
-->
152153
<field name="number" position="attributes">
153154
<attribute name="invisible">1</attribute>
154155
</field>

0 commit comments

Comments
 (0)