Release 6.0

This commit is contained in:
Oscar 2021-06-01 00:43:54 -05:00
parent a3f90cbdb2
commit 59318cbcfa
13 changed files with 45 additions and 53 deletions

View File

@ -1,4 +1,4 @@
Copyright (C) 2015 Presik Technologies.
Copyright (C) 2015-2021 Presik Technologies.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -4,7 +4,7 @@ Installing Trytonp Product Onebarcode
Prerequisites
-------------
* Python 2.7 or later (http://www.python.org/)
* Python 3.7 or later (http://www.python.org/)
* trytond (http://www.tryton.org/)
* trytond_product (http://www.tryton.org/)
* Optional: barcodenumber (https://pypi.python.org/pypi/barcodenumber/)

View File

@ -3,12 +3,12 @@
#the full copyright notices and license terms.
from trytond.pool import Pool
from .product import Template, Product
from .location import ProductLocation
from . import product
from . import position
def register():
Pool.register(
ProductLocation,
Product,
Template,
position.ProductPosition,
product.Product,
product.Template,
module='product_onebarcode', type_='model')

View File

@ -2,26 +2,19 @@
# this repository contains the full copyright notices and license terms.
from trytond.model import ModelView, ModelSQL, fields
__all__ = ['ProductLocation']
class ProductLocation(ModelSQL, ModelView):
"Product Location"
__name__ = "product.location"
class ProductPosition(ModelSQL, ModelView):
"Product Position"
__name__ = "product.position"
name = fields.Char('Name', required=True)
parent = fields.Many2One('product.location','Parent', select=True)
childs = fields.One2Many('product.location', 'parent', string='Children')
parent = fields.Many2One('product.position','Parent', select=True)
childs = fields.One2Many('product.position', 'parent', string='Children')
@classmethod
def __setup__(cls):
super(ProductLocation, cls).__setup__()
super(ProductPosition, cls).__setup__()
cls._order.insert(0, ('name', 'ASC'))
# @classmethod
# def validate(cls, locations):
# super(ProductLocation, cls).validate(locations)
# # cls.check_recursion(locations, rec_name='name')
def get_rec_name(self, name):
if self.parent:
return self.parent.get_rec_name(name) + ' / ' + self.name

View File

@ -4,53 +4,53 @@ this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.ui.view" id="location_view_tree">
<field name="model">product.location</field>
<record model="ir.ui.view" id="position_view_tree">
<field name="model">product.position</field>
<field name="type">tree</field>
<field name="priority">10</field>
<field name="name">location_tree</field>
<field name="name">position_tree</field>
</record>
<record model="ir.ui.view" id="location_view_tree2">
<field name="model">product.location</field>
<record model="ir.ui.view" id="position_view_tree2">
<field name="model">product.position</field>
<field name="type">tree</field>
<field name="priority">20</field>
<field name="field_childs">childs</field>
<field name="name">location_tree2</field>
<field name="name">position_tree2</field>
</record>
<record model="ir.ui.view" id="location_view_form">
<field name="model">product.location</field>
<record model="ir.ui.view" id="position_view_form">
<field name="model">product.position</field>
<field name="type">form</field>
<field name="name">location_form</field>
<field name="name">position_form</field>
</record>
<record model="ir.action.act_window" id="act_location_tree">
<field name="name">Locations</field>
<field name="res_model">product.location</field>
<record model="ir.action.act_window" id="act_position_tree">
<field name="name">Positions</field>
<field name="res_model">product.position</field>
<field name="domain" eval="[('parent', '=', None)]" pyson="1"/>
</record>
<record model="ir.action.act_window.view" id="act_location_tree_view1">
<record model="ir.action.act_window.view" id="act_position_tree_view1">
<field name="sequence" eval="1"/>
<field name="view" ref="location_view_tree2"/>
<field name="act_window" ref="act_location_tree"/>
<field name="view" ref="position_view_tree2"/>
<field name="act_window" ref="act_position_tree"/>
</record>
<record model="ir.action.act_window.view" id="act_location_tree_view2">
<record model="ir.action.act_window.view" id="act_position_tree_view2">
<field name="sequence" eval="2"/>
<field name="view" ref="location_view_form"/>
<field name="act_window" ref="act_location_tree"/>
<field name="view" ref="position_view_form"/>
<field name="act_window" ref="act_position_tree"/>
</record>
<menuitem parent="product.menu_main_product" sequence="1"
action="act_location_tree" id="menu_location_tree"/>
action="act_position_tree" id="menu_position_tree"/>
<record model="ir.model.access" id="access_product_location">
<field name="model" search="[('model', '=', 'product.location')]"/>
<record model="ir.model.access" id="access_product_position">
<field name="model" search="[('model', '=', 'product.position')]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_delete" eval="False"/>
</record>
<record model="ir.model.access" id="access_product_location_admin">
<field name="model" search="[('model', '=', 'product.location')]"/>
<record model="ir.model.access" id="access_product_position_admin">
<field name="model" search="[('model', '=', 'product.position')]"/>
<field name="group" ref="product.group_product_admin"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>

View File

@ -5,8 +5,6 @@ from trytond.model import fields
from trytond.pool import PoolMeta
from trytond.transaction import Transaction
__all__ = ['Template', 'Product']
SHORT_NAME_LEN = 25
@ -25,7 +23,8 @@ class Product(metaclass=PoolMeta):
barcode = fields.Char('Barcode')
short_name = fields.Char('Short Name', depends=['name'])
tag = fields.Char('Tag')
location = fields.Many2One('product.location', 'Location')
# rename table product.location to product.position
position = fields.Many2One('product.position', 'Position')
@classmethod
def __setup__(cls):

View File

@ -22,11 +22,11 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
<field name="name">product_tree</field>
</record>
<record model="ir.ui.view" id="product_view_tree_qty">
<!-- <record model="ir.ui.view" id="product_view_tree_qty">
<field name="model">product.product</field>
<field name="inherit" ref="stock.product_view_tree_qty"/>
<field name="name">product_tree_qty</field>
</record>
</record> -->
</data>
</tryton>

View File

@ -1,7 +1,7 @@
[tryton]
version=5.0.0
version=6.0.0
depends:
product
xml:
product.xml
location.xml
position.xml

View File

@ -8,8 +8,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="barcode"/>
<label name="short_name"/>
<field name="short_name"/>
<label name="location"/>
<field name="location"/>
<label name="position"/>
<field name="position"/>
<label name="tag"/>
<field name="tag"/>
</xpath>

View File

@ -4,6 +4,6 @@ this repository contains the full copyright notices and license terms. -->
<data>
<xpath
expr="/tree/field[@name='cost_value']" position="after">
<field name="location"/>
<field name="position"/>
</xpath>
</data>