diff options
| -rw-r--r-- | indoteknik_custom/models/invoice_reklas.py | 3 | ||||
| -rw-r--r-- | indoteknik_custom/views/account_move.xml | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/indoteknik_custom/models/invoice_reklas.py b/indoteknik_custom/models/invoice_reklas.py index 5145e098..58299d3e 100644 --- a/indoteknik_custom/models/invoice_reklas.py +++ b/indoteknik_custom/models/invoice_reklas.py @@ -102,6 +102,9 @@ class InvoiceReklas(models.TransientModel): 'journal_id': 13 } + if invoice.purchase_order_id: + parameters_header['purchase_order_id'] = invoice.purchase_order_id.id + account_move = request.env['account.move'].create([parameters_header]) _logger.info('Success Reklas with %s' % account_move.name) diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index 0c2f9a68..d2b03b1d 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -37,8 +37,8 @@ </field> <field name="ref" position="after"> <field name="sale_id" readonly="1" attrs="{'invisible': [('move_type', '!=', 'entry')]}"/> - <!-- <field name="purchase_order_id" context="{'form_view_ref': 'purchase.purchase_order_form'}" options="{'no_create': True}"/> --> - <field name="bill_id" readonly="1" attrs="{'invisible': ['|', ('move_type', '!=', 'entry'), ('purchase_order_id', '!=', False)]}"/> + <field name="purchase_order_id" context="{'form_view_ref': 'purchase.purchase_order_form'}" options="{'no_create': True}"/> + <field name="bill_id" readonly="1"/> </field> <field name="partner_shipping_id" position="before"> <field name="real_invoice_id" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/> |
