Add printer server to shop

This commit is contained in:
oscar alvarez 2022-04-08 17:03:27 -05:00
parent 7239ebb8c1
commit 57a48e2e37
6 changed files with 35 additions and 14 deletions

View File

@ -8,6 +8,7 @@ from . import production
from . import product
from . import invoice
from . import agent
from . import shop
def register():
@ -15,11 +16,11 @@ def register():
restaurant.SaleShopTable,
restaurant.Reservation,
restaurant.PartyConsumer,
sale.Shop,
sale.Sale,
sale.SaleForceDraft,
sale.SaleLine,
sale.SaleMove,
shop.Shop,
production.Production,
product.ProductMixOption,
product.Product,

View File

@ -80,7 +80,7 @@ class Sale(metaclass=PoolMeta):
tables = ShopTable.search([('sale', 'in', [s.id for s in sales])])
if tables:
ShopTable.write(tables, {'sale': None, 'state':'available'})
@classmethod
def transition_pay_(cls, sales_to_pay):
@ -315,11 +315,6 @@ class SaleLine(metaclass=PoolMeta):
production = fields.Many2One('production', 'Production')
class Shop(metaclass=PoolMeta):
__name__ = 'sale.shop'
tables = fields.One2Many('sale.shop.table', 'shop', 'Tables')
class SaleSquareBoxGlobal(SaleSquareBox):
'Sale Square Box Global'
__name__ = 'sale_pos_frontend_rest.sale_square_box_global'

View File

@ -14,11 +14,6 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
<field name="inherit" ref="sale.sale_view_form"/>
<field name="name">sale_form</field>
</record>
<record model="ir.ui.view" id="sale_shop_view_form">
<field name="model">sale.shop</field>
<field name="inherit" ref="sale_shop.sale_shop_view_form"/>
<field name="name">sale_shop_form</field>
</record>
<record model="ir.ui.view" id="sale_line_view_form">
<field name="model">sale.line</field>
<field name="inherit" ref="sale.sale_line_view_form"/>

11
shop.py Normal file
View File

@ -0,0 +1,11 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import fields
from trytond.pool import PoolMeta
class SaleShop(metaclass=PoolMeta):
__name__ = 'sale.shop'
tables = fields.One2Many('sale.shop.table', 'shop', 'Tables')
local_printer = fields.Char('Local Printer Server',
help="Example: http://192.168.0.122:7001")

14
shop.xml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!-- This file is part sale_shop module for Tryton.
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.ui.view" id="sale_shop_view_form">
<field name="model">sale.shop</field>
<field name="inherit" ref="sale_shop.sale_shop_view_form"/>
<field name="name">sale_shop_form</field>
</record>
</data>
</tryton>

View File

@ -2,8 +2,13 @@
<!-- This file is part sale_shop module for Tryton.
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='users']"
position="after">
<xpath expr="/form/notebook/page[@id='general']/field[@name='warehouse']"
position="after">
<label name="local_printer"/>
<field name="local_printer"/>
</xpath>
<xpath expr="/form/notebook/page[@id='users']" position="after">
<page string="Tables" col="4" id="tables">
<field name="tables" colspan="4"/>
</page>