Upgrade to 5.x

This commit is contained in:
Raimon Esteve 2019-07-06 19:47:56 +02:00
parent 4cc3eab12f
commit 53283d8307
6 changed files with 12 additions and 15 deletions

View File

@ -2,14 +2,14 @@
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from trytond.pool import Pool
from .shop import *
from .journal import *
from .sale import *
from . import shop
from . import journal
from . import sale
def register():
Pool.register(
Journal,
SaleShop,
Sale,
journal.Journal,
shop.SaleShop,
sale.Sale,
module='sale_shop_invoice_journal', type_='model')

View File

@ -8,8 +8,7 @@ from trytond.pool import PoolMeta
__all__ = ['Journal']
class Journal:
__metaclass__ = PoolMeta
class Journal(metaclass=PoolMeta):
__name__ = 'account.journal'
shops = fields.One2Many('sale.shop', 'journal', 'Shops',
states={

View File

@ -6,13 +6,12 @@ from trytond.pool import PoolMeta
__all__ = ['Sale']
class Sale:
__metaclass__ = PoolMeta
class Sale(metaclass=PoolMeta):
__name__ = 'sale.sale'
def _get_invoice_sale(self):
invoice = super(Sale, self)._get_invoice_sale()
journal = self.shop and self.shop.journal or False
journal = self.shop and self.shop.journal
if journal:
invoice.journal = journal
return invoice

View File

@ -7,8 +7,7 @@ from trytond.pool import PoolMeta
__all__ = ['SaleShop']
class SaleShop:
__metaclass__ = PoolMeta
class SaleShop(metaclass=PoolMeta):
__name__ = 'sale.shop'
journal = fields.Many2One('account.journal', 'Account Journal',
domain=[('type', '=', 'revenue')])

View File

@ -1,5 +1,5 @@
[tryton]
version=4.1.0
version=5.0.0
depends:
ir
res

View File

@ -3,7 +3,7 @@
The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<data>
<xpath expr="/form/notebook/page[@id='sequences']" position="after">
<xpath expr="/form/notebook/page[@id='general']" position="after">
<page string="Shops" id="shops">
<field name="shops" colspan="4" widget="many2many"/>
</page>