mirror of
https://bitbucket.org/presik/trytonpsk-product_onebarcode.git
synced 2023-12-14 05:02:58 +01:00
Release 6.0
This commit is contained in:
parent
a3f90cbdb2
commit
59318cbcfa
|
@ -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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
2
INSTALL
2
INSTALL
|
@ -4,7 +4,7 @@ Installing Trytonp Product Onebarcode
|
||||||
Prerequisites
|
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 (http://www.tryton.org/)
|
||||||
* trytond_product (http://www.tryton.org/)
|
* trytond_product (http://www.tryton.org/)
|
||||||
* Optional: barcodenumber (https://pypi.python.org/pypi/barcodenumber/)
|
* Optional: barcodenumber (https://pypi.python.org/pypi/barcodenumber/)
|
||||||
|
|
10
__init__.py
10
__init__.py
|
@ -3,12 +3,12 @@
|
||||||
#the full copyright notices and license terms.
|
#the full copyright notices and license terms.
|
||||||
|
|
||||||
from trytond.pool import Pool
|
from trytond.pool import Pool
|
||||||
from .product import Template, Product
|
from . import product
|
||||||
from .location import ProductLocation
|
from . import position
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
Pool.register(
|
Pool.register(
|
||||||
ProductLocation,
|
position.ProductPosition,
|
||||||
Product,
|
product.Product,
|
||||||
Template,
|
product.Template,
|
||||||
module='product_onebarcode', type_='model')
|
module='product_onebarcode', type_='model')
|
||||||
|
|
|
@ -2,26 +2,19 @@
|
||||||
# this repository contains the full copyright notices and license terms.
|
# this repository contains the full copyright notices and license terms.
|
||||||
from trytond.model import ModelView, ModelSQL, fields
|
from trytond.model import ModelView, ModelSQL, fields
|
||||||
|
|
||||||
__all__ = ['ProductLocation']
|
|
||||||
|
|
||||||
|
class ProductPosition(ModelSQL, ModelView):
|
||||||
class ProductLocation(ModelSQL, ModelView):
|
"Product Position"
|
||||||
"Product Location"
|
__name__ = "product.position"
|
||||||
__name__ = "product.location"
|
|
||||||
name = fields.Char('Name', required=True)
|
name = fields.Char('Name', required=True)
|
||||||
parent = fields.Many2One('product.location','Parent', select=True)
|
parent = fields.Many2One('product.position','Parent', select=True)
|
||||||
childs = fields.One2Many('product.location', 'parent', string='Children')
|
childs = fields.One2Many('product.position', 'parent', string='Children')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
super(ProductLocation, cls).__setup__()
|
super(ProductPosition, cls).__setup__()
|
||||||
cls._order.insert(0, ('name', 'ASC'))
|
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):
|
def get_rec_name(self, name):
|
||||||
if self.parent:
|
if self.parent:
|
||||||
return self.parent.get_rec_name(name) + ' / ' + self.name
|
return self.parent.get_rec_name(name) + ' / ' + self.name
|
|
@ -4,53 +4,53 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<tryton>
|
<tryton>
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="location_view_tree">
|
<record model="ir.ui.view" id="position_view_tree">
|
||||||
<field name="model">product.location</field>
|
<field name="model">product.position</field>
|
||||||
<field name="type">tree</field>
|
<field name="type">tree</field>
|
||||||
<field name="priority">10</field>
|
<field name="priority">10</field>
|
||||||
<field name="name">location_tree</field>
|
<field name="name">position_tree</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.ui.view" id="location_view_tree2">
|
<record model="ir.ui.view" id="position_view_tree2">
|
||||||
<field name="model">product.location</field>
|
<field name="model">product.position</field>
|
||||||
<field name="type">tree</field>
|
<field name="type">tree</field>
|
||||||
<field name="priority">20</field>
|
<field name="priority">20</field>
|
||||||
<field name="field_childs">childs</field>
|
<field name="field_childs">childs</field>
|
||||||
<field name="name">location_tree2</field>
|
<field name="name">position_tree2</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.ui.view" id="location_view_form">
|
<record model="ir.ui.view" id="position_view_form">
|
||||||
<field name="model">product.location</field>
|
<field name="model">product.position</field>
|
||||||
<field name="type">form</field>
|
<field name="type">form</field>
|
||||||
<field name="name">location_form</field>
|
<field name="name">position_form</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.action.act_window" id="act_location_tree">
|
<record model="ir.action.act_window" id="act_position_tree">
|
||||||
<field name="name">Locations</field>
|
<field name="name">Positions</field>
|
||||||
<field name="res_model">product.location</field>
|
<field name="res_model">product.position</field>
|
||||||
<field name="domain" eval="[('parent', '=', None)]" pyson="1"/>
|
<field name="domain" eval="[('parent', '=', None)]" pyson="1"/>
|
||||||
</record>
|
</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="sequence" eval="1"/>
|
||||||
<field name="view" ref="location_view_tree2"/>
|
<field name="view" ref="position_view_tree2"/>
|
||||||
<field name="act_window" ref="act_location_tree"/>
|
<field name="act_window" ref="act_position_tree"/>
|
||||||
</record>
|
</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="sequence" eval="2"/>
|
||||||
<field name="view" ref="location_view_form"/>
|
<field name="view" ref="position_view_form"/>
|
||||||
<field name="act_window" ref="act_location_tree"/>
|
<field name="act_window" ref="act_position_tree"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem parent="product.menu_main_product" sequence="1"
|
<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">
|
<record model="ir.model.access" id="access_product_position">
|
||||||
<field name="model" search="[('model', '=', 'product.location')]"/>
|
<field name="model" search="[('model', '=', 'product.position')]"/>
|
||||||
<field name="perm_read" eval="True"/>
|
<field name="perm_read" eval="True"/>
|
||||||
<field name="perm_write" eval="False"/>
|
<field name="perm_write" eval="False"/>
|
||||||
<field name="perm_create" eval="False"/>
|
<field name="perm_create" eval="False"/>
|
||||||
<field name="perm_delete" eval="False"/>
|
<field name="perm_delete" eval="False"/>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.model.access" id="access_product_location_admin">
|
<record model="ir.model.access" id="access_product_position_admin">
|
||||||
<field name="model" search="[('model', '=', 'product.location')]"/>
|
<field name="model" search="[('model', '=', 'product.position')]"/>
|
||||||
<field name="group" ref="product.group_product_admin"/>
|
<field name="group" ref="product.group_product_admin"/>
|
||||||
<field name="perm_read" eval="True"/>
|
<field name="perm_read" eval="True"/>
|
||||||
<field name="perm_write" eval="True"/>
|
<field name="perm_write" eval="True"/>
|
|
@ -5,8 +5,6 @@ from trytond.model import fields
|
||||||
from trytond.pool import PoolMeta
|
from trytond.pool import PoolMeta
|
||||||
from trytond.transaction import Transaction
|
from trytond.transaction import Transaction
|
||||||
|
|
||||||
__all__ = ['Template', 'Product']
|
|
||||||
|
|
||||||
SHORT_NAME_LEN = 25
|
SHORT_NAME_LEN = 25
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +23,8 @@ class Product(metaclass=PoolMeta):
|
||||||
barcode = fields.Char('Barcode')
|
barcode = fields.Char('Barcode')
|
||||||
short_name = fields.Char('Short Name', depends=['name'])
|
short_name = fields.Char('Short Name', depends=['name'])
|
||||||
tag = fields.Char('Tag')
|
tag = fields.Char('Tag')
|
||||||
location = fields.Many2One('product.location', 'Location')
|
# rename table product.location to product.position
|
||||||
|
position = fields.Many2One('product.position', 'Position')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
|
|
|
@ -22,11 +22,11 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
|
||||||
<field name="name">product_tree</field>
|
<field name="name">product_tree</field>
|
||||||
</record>
|
</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="model">product.product</field>
|
||||||
<field name="inherit" ref="stock.product_view_tree_qty"/>
|
<field name="inherit" ref="stock.product_view_tree_qty"/>
|
||||||
<field name="name">product_tree_qty</field>
|
<field name="name">product_tree_qty</field>
|
||||||
</record>
|
</record> -->
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</tryton>
|
</tryton>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[tryton]
|
[tryton]
|
||||||
version=5.0.0
|
version=6.0.0
|
||||||
depends:
|
depends:
|
||||||
product
|
product
|
||||||
xml:
|
xml:
|
||||||
product.xml
|
product.xml
|
||||||
location.xml
|
position.xml
|
||||||
|
|
|
@ -8,8 +8,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<field name="barcode"/>
|
<field name="barcode"/>
|
||||||
<label name="short_name"/>
|
<label name="short_name"/>
|
||||||
<field name="short_name"/>
|
<field name="short_name"/>
|
||||||
<label name="location"/>
|
<label name="position"/>
|
||||||
<field name="location"/>
|
<field name="position"/>
|
||||||
<label name="tag"/>
|
<label name="tag"/>
|
||||||
<field name="tag"/>
|
<field name="tag"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
|
@ -4,6 +4,6 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<data>
|
<data>
|
||||||
<xpath
|
<xpath
|
||||||
expr="/tree/field[@name='cost_value']" position="after">
|
expr="/tree/field[@name='cost_value']" position="after">
|
||||||
<field name="location"/>
|
<field name="position"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</data>
|
</data>
|
||||||
|
|
Loading…
Reference in a new issue