Upgrade to 5.x
This commit is contained in:
parent
4cc3eab12f
commit
53283d8307
12
__init__.py
12
__init__.py
|
@ -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')
|
||||
|
|
|
@ -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={
|
||||
|
|
5
sale.py
5
sale.py
|
@ -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
|
||||
|
|
3
shop.py
3
shop.py
|
@ -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')])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=4.1.0
|
||||
version=5.0.0
|
||||
depends:
|
||||
ir
|
||||
res
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue