Browse Source

[MIG] contract_payment_mode: Migration to 11.0

pull/164/head
cubells 7 years ago
parent
commit
f07244783d
  1. 2
      contract_payment_mode/README.rst
  2. 1
      contract_payment_mode/__init__.py
  3. 5
      contract_payment_mode/__manifest__.py
  4. 1
      contract_payment_mode/hooks.py
  5. 1
      contract_payment_mode/models/__init__.py
  6. 4
      contract_payment_mode/models/contract.py
  7. 1
      contract_payment_mode/tests/__init__.py
  8. 1
      contract_payment_mode/tests/test_contract_payment.py
  9. 2
      contract_payment_mode/views/contract_view.xml
  10. 1
      oca_dependencies.txt

2
contract_payment_mode/README.rst

@ -30,7 +30,7 @@ Usage
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot :alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/110/10.0
:target: https://runbot.odoo-community.org/runbot/110/11.0
Bug Tracker Bug Tracker
=========== ===========

1
contract_payment_mode/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models from . import models

5
contract_payment_mode/__manifest__.py

@ -1,15 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Domatix (<www.domatix.com>) # Copyright 2015 Domatix (<www.domatix.com>)
# Copyright 2016 Antiun Ingenieria S.L. - Antonio Espinosa # Copyright 2016 Antiun Ingenieria S.L. - Antonio Espinosa
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2017 Tecnativa - David Vidal # Copyright 2017 Tecnativa - David Vidal
# Copyright 2017 Tecnativa - Carlos Dauden <carlos.dauden@tecnativa.com> # Copyright 2017 Tecnativa - Carlos Dauden <carlos.dauden@tecnativa.com>
# Copyright 2017-2018 Tecnativa - Vicent Cubells <vicent.cubells@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
'name': 'Contract Payment Mode', 'name': 'Contract Payment Mode',
'summary': 'Payment mode in contracts and their invoices', 'summary': 'Payment mode in contracts and their invoices',
'version': '10.0.1.0.1',
'version': '11.0.1.0.0',
'author': 'Domatix, ' 'author': 'Domatix, '
'Tecnativa, ' 'Tecnativa, '
'Odoo Community Association (OCA)', 'Odoo Community Association (OCA)',

1
contract_payment_mode/hooks.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Antiun Ingenieria S.L. - Antonio Espinosa # Copyright 2016 Antiun Ingenieria S.L. - Antonio Espinosa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

1
contract_payment_mode/models/__init__.py

@ -1,2 +1 @@
# -*- coding: utf-8 -*-
from . import contract from . import contract

4
contract_payment_mode/models/contract.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models from odoo import api, fields, models
@ -13,7 +12,6 @@ class AccountAnalyticAccount(models.Model):
@api.onchange('partner_id') @api.onchange('partner_id')
def on_change_partner_id(self): def on_change_partner_id(self):
if self.partner_id.customer_payment_mode_id:
self.payment_mode_id = self.partner_id.customer_payment_mode_id.id self.payment_mode_id = self.partner_id.customer_payment_mode_id.id
@api.multi @api.multi
@ -22,6 +20,6 @@ class AccountAnalyticAccount(models.Model):
if self.payment_mode_id: if self.payment_mode_id:
invoice_vals['payment_mode_id'] = self.payment_mode_id.id invoice_vals['payment_mode_id'] = self.payment_mode_id.id
invoice = self.env['account.invoice'].new(invoice_vals) invoice = self.env['account.invoice'].new(invoice_vals)
invoice.payment_mode_id_change()
invoice._onchange_payment_mode_id()
invoice_vals = invoice._convert_to_write(invoice._cache) invoice_vals = invoice._convert_to_write(invoice._cache)
return invoice_vals return invoice_vals

1
contract_payment_mode/tests/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Antiun Ingenieria S.L. - Antonio Espinosa # Copyright 2016 Antiun Ingenieria S.L. - Antonio Espinosa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

1
contract_payment_mode/tests/test_contract_payment.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Antiun Ingenieria S.L. - Antonio Espinosa # Copyright 2015 Antiun Ingenieria S.L. - Antonio Espinosa
# Copyright 2017 Tecnativa - Vicent Cubells # Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2017 Tecnativa - David Vidal # Copyright 2017 Tecnativa - David Vidal

2
contract_payment_mode/views/contract_view.xml

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<record id="account_analytic_account_payment_form" model="ir.ui.view"> <record id="account_analytic_account_payment_form" model="ir.ui.view">

1
oca_dependencies.txt

@ -0,0 +1 @@
bank-payment
Loading…
Cancel
Save