mirror of
https://github.com/NaN-tic/trytond-sale_project_template.git
synced 2023-12-14 02:12:56 +01:00
Use active_ids in relate actions
This commit is contained in:
parent
c08d26758d
commit
ebbbcc0bbb
3 changed files with 10 additions and 2 deletions
|
@ -10,6 +10,7 @@ def register():
|
|||
Pool.register(
|
||||
Sale,
|
||||
SaleLine,
|
||||
Work,
|
||||
Product,
|
||||
ConfigurationCompany,
|
||||
Configuration,
|
||||
|
|
9
sale.py
9
sale.py
|
@ -5,7 +5,7 @@ from trytond.pool import Pool, PoolMeta
|
|||
from trytond.transaction import Transaction
|
||||
from trytond.pyson import Eval, Bool
|
||||
|
||||
__all__ = ['Sale', 'SaleLine', 'ConfigurationCompany', 'Configuration']
|
||||
__all__ = ['Sale', 'SaleLine', 'ConfigurationCompany', 'Configuration', 'Work']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
PROJECT_METHODS = [
|
||||
|
@ -163,3 +163,10 @@ class SaleLine():
|
|||
def create_works(cls, lines):
|
||||
for line in lines:
|
||||
line.create_work()
|
||||
|
||||
|
||||
class Work():
|
||||
__name__ = 'project.work'
|
||||
|
||||
sale_lines = fields.One2Many('sale.line', 'work', 'Sale Lines',
|
||||
readonly=True)
|
||||
|
|
2
sale.xml
2
sale.xml
|
@ -17,7 +17,7 @@
|
|||
<record model="ir.action.act_window" id="act_work_form">
|
||||
<field name="name">Project/Task</field>
|
||||
<field name="res_model">project.work</field>
|
||||
<field name="domain">[('id', '=', Eval('work'))]</field>
|
||||
<field name="domain">[('sale_lines', 'in', Eval('active_ids'))]</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword" id="act_work_keyword1">
|
||||
<field name="keyword">form_relate</field>
|
||||
|
|
Loading…
Reference in a new issue