traingsprodukte und nutzungsprodukte als Liste
This commit is contained in:
parent
a8aa4798b1
commit
9bfea2b586
|
|
@ -1 +1 @@
|
||||||
/opt/odoo/odoo/odoo-bin -d hobbyhimmel13_dev -i pos_time_based_products,wk_coupons,pos_coupons,open_workshop --stop-after-init --load-language=de_DE
|
/opt/odoo/odoo/odoo-bin -d hobbyhimmel13_dev -i base,sale,pos_time_based_products,wk_coupons,pos_coupons,open_workshop --stop-after-init --load-language=de_DE
|
||||||
|
|
@ -179,20 +179,24 @@ class OwsMachine(models.Model):
|
||||||
code = fields.Char(required=True, help="Eindeutiger Kurzcode, z.B. 'lasercutter'")
|
code = fields.Char(required=True, help="Eindeutiger Kurzcode, z.B. 'lasercutter'")
|
||||||
description = fields.Text()
|
description = fields.Text()
|
||||||
active = fields.Boolean(default=True)
|
active = fields.Boolean(default=True)
|
||||||
|
|
||||||
area_id = fields.Many2one('ows.machine.area', string='Bereich')
|
area_id = fields.Many2one('ows.machine.area', string='Bereich')
|
||||||
|
product_ids = fields.One2many('ows.machine.product', 'machine_id', string="Nutzungsprodukte")
|
||||||
product_ids = fields.One2many('ows.machine.product', 'machine_id', string="Einweisungsprodukte")
|
product_names = fields.Char(string="Nutzungsprodukte Liste", compute="_compute_product_using_names", store=False,)
|
||||||
product_names = fields.Char(string="Einweisungsprodukte", compute="_compute_product_names", store=False,)
|
training_ids = fields.One2many('ows.machine.training', 'machine_id', string="Einweisungsprodukte")
|
||||||
machine_product = fields.Many2one('product.product', string="Nutzungsprodukt", domain="[('available_in_pos', '=', True)]")
|
training_names = fields.Char(string="Einweisungsprodukte Liste", compute="_compute_product_training_names", store=False,)
|
||||||
#machine_product = fields.Many2one('product.product', string="Nutzungsprodukt")
|
|
||||||
|
|
||||||
@api.depends('product_ids.product_id.name')
|
@api.depends('product_ids.product_id.name')
|
||||||
def _compute_product_names(self):
|
def _compute_product_using_names(self):
|
||||||
for machine in self:
|
for machine in self:
|
||||||
names = machine.product_ids.mapped('product_id.name')
|
names = machine.product_ids.mapped('product_id.name')
|
||||||
machine.product_names = ", ".join(names)
|
machine.product_names = ", ".join(names)
|
||||||
|
|
||||||
|
@api.depends('training_ids.training_id.name')
|
||||||
|
def _compute_product_training_names(self):
|
||||||
|
for machine in self:
|
||||||
|
names = machine.training_ids.mapped('training_id.name')
|
||||||
|
machine.training_names = ", ".join(names)
|
||||||
|
|
||||||
_sql_constraints = [
|
_sql_constraints = [
|
||||||
('code_unique', 'unique(code)', 'Maschinencode muss eindeutig sein.')
|
('code_unique', 'unique(code)', 'Maschinencode muss eindeutig sein.')
|
||||||
]
|
]
|
||||||
|
|
@ -246,9 +250,15 @@ class OwsMachineAccess(models.Model):
|
||||||
class OwsMachineProduct(models.Model):
|
class OwsMachineProduct(models.Model):
|
||||||
_name = 'ows.machine.product'
|
_name = 'ows.machine.product'
|
||||||
_table = 'ows_machine_product'
|
_table = 'ows_machine_product'
|
||||||
_description = 'OWS: Zurordnung Produkt der Einweisung zur die Maschine'
|
_description = 'OWS: Zurordnung Produkt der Nutzung zur die Maschine'
|
||||||
|
|
||||||
product_id = fields.Many2one('product.product', required=True, domain=[('available_in_pos', '=', True)], ondelete='cascade')
|
product_id = fields.Many2one('product.product', required=True, domain=[('available_in_pos', '=', True)], ondelete='cascade')
|
||||||
machine_id = fields.Many2one('ows.machine', required=True, ondelete='cascade')
|
machine_id = fields.Many2one('ows.machine', required=True, ondelete='cascade')
|
||||||
|
|
||||||
|
class OwsMachineTraining(models.Model):
|
||||||
|
_name = 'ows.machine.training'
|
||||||
|
_table = 'ows_machine_training'
|
||||||
|
_description = 'OWS: Zurordnung Produkt der Einweisung zur die Maschine'
|
||||||
|
|
||||||
|
training_id = fields.Many2one('product.product', required=True, domain=[('available_in_pos', '=', True)], ondelete='cascade')
|
||||||
|
machine_id = fields.Many2one('ows.machine', required=True, ondelete='cascade')
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ class PosOrder(models.Model):
|
||||||
pos_order_id = super(PosOrder, self)._process_order(order, draft, existing_order)
|
pos_order_id = super(PosOrder, self)._process_order(order, draft, existing_order)
|
||||||
pos_order = self.browse(pos_order_id)
|
pos_order = self.browse(pos_order_id)
|
||||||
|
|
||||||
training_products = self.env['ows.machine.product'].search([])
|
training_products = self.env['ows.machine.training'].search([])
|
||||||
product_map = {
|
product_map = {
|
||||||
tp.product_id.product_tmpl_id.id: tp.machine_id.id
|
tp.product_id.product_tmpl_id.id: tp.machine_id.id
|
||||||
for tp in training_products
|
for tp in training_products
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,5 @@ access_ows_machine_access_user,ows.machine.access,model_ows_machine_access,base.
|
||||||
access_ows_machine_user,ows.machine,model_ows_machine,base.group_user,1,1,1,1
|
access_ows_machine_user,ows.machine,model_ows_machine,base.group_user,1,1,1,1
|
||||||
access_ows_machine_product_user,ows.machine.product,model_ows_machine_product,base.group_user,1,1,1,1
|
access_ows_machine_product_user,ows.machine.product,model_ows_machine_product,base.group_user,1,1,1,1
|
||||||
access_ows_machine_area,ows.machine.area,model_ows_machine_area,base.group_user,1,1,1,1
|
access_ows_machine_area,ows.machine.area,model_ows_machine_area,base.group_user,1,1,1,1
|
||||||
access_ows_user,ows.user,model_ows_machine_area,base.group_user,1,1,1,1
|
access_ows_user,ows.user,model_ows_user,base.group_user,1,1,1,1
|
||||||
|
access_ows_machine_training,ows.machine.training,model_ows_machine_training,base.group_user,1,1,1,1
|
||||||
|
|
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
<field name="area_id" widget="many2one_color"/>
|
<field name="area_id" widget="many2one_color"/>
|
||||||
<field name="machine_product" widget="many2one"/>
|
|
||||||
<field name="product_names"/>
|
<field name="product_names"/>
|
||||||
|
<field name="training_names"/>
|
||||||
<field name="active"/>
|
<field name="active"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
|
|
@ -27,20 +27,26 @@
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
<field name="area_id"/>
|
<field name="area_id"/>
|
||||||
<field name="machine_product"/>
|
|
||||||
<field name="description"/>
|
<field name="description"/>
|
||||||
<field name="active"/>
|
<field name="active"/>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<!-- Neue Einweisungsprodukte-Tabelle -->
|
<!-- Neue -->
|
||||||
<notebook>
|
<notebook>
|
||||||
<page string="Einweisungsprodukte">
|
<page string="Nutzungsprodukte">
|
||||||
<field name="product_ids" context="{'default_machine_id': active_id}">
|
<field name="product_ids" context="{'default_machine_id': active_id}">
|
||||||
<tree editable="bottom">
|
<tree editable="bottom">
|
||||||
<field name="product_id"/>
|
<field name="product_id"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
|
<page string="Einweisungsprodukte">
|
||||||
|
<field name="training_ids" context="{'default_machine_id': active_id}">
|
||||||
|
<tree editable="bottom">
|
||||||
|
<field name="training_id"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</page>
|
||||||
</notebook>
|
</notebook>
|
||||||
</sheet>
|
</sheet>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -28,25 +28,25 @@
|
||||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
|
|
||||||
<!-- Geburtstag direkt unter USt-ID -->
|
<!-- Geburtstag direkt unter USt-ID -->
|
||||||
<xpath expr="//field[@name='vat']" position="after">
|
<xpath expr="//field[@name='vat']" position="after">
|
||||||
<field name="birthday"/>
|
<field name="birthday"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<!-- Eigene Seite "Basis" nach der Verkaufsseite -->
|
<!-- Eigene Seite "Basis" nach der Verkaufsseite -->
|
||||||
<xpath expr="//page[@name='sales_purchases']" position="after">
|
<xpath expr="//page[@name='sales_purchases']" position="after">
|
||||||
<page name="ows_basic" string="HOBBYHIMMEL Basis">
|
<page name="ows_basic" string="HOBBYHIMMEL Basis">
|
||||||
<group name="container_row_2">
|
<group name="container_row_2">
|
||||||
<group string="Sicherheit">
|
<group string="Sicherheit">
|
||||||
<field name="security_briefing"/>
|
<field name="security_briefing"/>
|
||||||
<field name="security_id"/>
|
<field name="security_id"/>
|
||||||
</group>
|
|
||||||
<group string="Zugang">
|
|
||||||
<field name="rfid_card"/>
|
|
||||||
</group>
|
|
||||||
</group>
|
</group>
|
||||||
</page>
|
<group string="Zugang">
|
||||||
</xpath>
|
<field name="rfid_card"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
@ -68,4 +68,34 @@
|
||||||
<field name="view_id" ref="base.view_partner_tree"/>
|
<field name="view_id" ref="base.view_partner_tree"/>
|
||||||
</record>
|
</record>
|
||||||
-->
|
-->
|
||||||
|
<record id="ows_userList_inherit" model="ir.ui.view">
|
||||||
|
<field name="name">res.partner.ows.tree</field>
|
||||||
|
<field name="model">res.partner</field>
|
||||||
|
<field name="inherit_id" ref="base.view_partner_tree"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='vat']" position="after">
|
||||||
|
<field name="create_date" optional="show"/>
|
||||||
|
<field name="security_briefing" optional="show"/>
|
||||||
|
<field name="security_id" optional="show"/>
|
||||||
|
<field name="rfid_card" optional="show"/>
|
||||||
|
<field name="category_id" widget="many2many_tags"/>
|
||||||
|
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='vat']" position="replace">
|
||||||
|
<field name="vat" invisible="1"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='email']" position="replace">
|
||||||
|
<field name="email" invisible="1"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='phone']" position="replace">
|
||||||
|
<field name="phone" invisible="1"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='state_id']" position="replace">
|
||||||
|
<field name="state_id" invisible="1"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='country_id']" position="replace">
|
||||||
|
<field name="country_id" invisible="1"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user