Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions modules/account/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ class Account(
'readonly': _states['readonly'],
},
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
])
debit_type = fields.Many2One(
'account.account.type', "Debit Type", ondelete='RESTRICT',
Expand All @@ -888,7 +888,7 @@ class Account(
| (_states['readonly']) & ~Eval('debit_type')),
},
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
],
help="The type used if not empty and debit > credit.")
credit_type = fields.Many2One(
Expand All @@ -900,7 +900,7 @@ class Account(
| (_states['readonly']) & ~Eval('credit_type')),
},
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
],
help="The type used if not empty and debit < credit.")
parent = fields.Many2One(
Expand Down Expand Up @@ -949,7 +949,7 @@ class Account(
taxes = fields.Many2Many('account.account-account.tax',
'account', 'tax', 'Default Taxes',
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
('parent', '=', None),
],
help="Default tax for manual encoding of move lines\n"
Expand Down Expand Up @@ -2132,20 +2132,20 @@ class GeneralLedgerAccountContext(ModelView):
fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year',
required=True,
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
],
depends=['company'])
start_period = fields.Many2One('account.period', 'Start Period',
domain=[
('fiscalyear', '=', Eval('fiscalyear')),
('fiscalyear', '=', Eval('fiscalyear', -1)),
('start_date', '<=', (Eval('end_period'), 'start_date')),
],
states={
'invisible': Eval('from_date', False) | Eval('to_date', False),
})
end_period = fields.Many2One('account.period', 'End Period',
domain=[
('fiscalyear', '=', Eval('fiscalyear')),
('fiscalyear', '=', Eval('fiscalyear', -1)),
('start_date', '>=', (Eval('start_period'), 'start_date'))
],
states={
Expand Down Expand Up @@ -2635,19 +2635,19 @@ class IncomeStatementContext(ModelView):
fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year',
required=True,
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
])
start_period = fields.Many2One('account.period', 'Start Period',
domain=[
('fiscalyear', '=', Eval('fiscalyear')),
('fiscalyear', '=', Eval('fiscalyear', -1)),
('start_date', '<=', (Eval('end_period'), 'start_date'))
],
states={
'invisible': Eval('from_date', False) | Eval('to_date', False),
})
end_period = fields.Many2One('account.period', 'End Period',
domain=[
('fiscalyear', '=', Eval('fiscalyear')),
('fiscalyear', '=', Eval('fiscalyear', -1)),
('start_date', '>=', (Eval('start_period'), 'start_date')),
],
states={
Expand Down Expand Up @@ -2682,19 +2682,19 @@ class IncomeStatementContext(ModelView):
'invisible': ~Eval('comparison', False),
},
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
])
start_period_cmp = fields.Many2One('account.period', 'Start Period',
domain=[
('fiscalyear', '=', Eval('fiscalyear_cmp')),
('fiscalyear', '=', Eval('fiscalyear_cmp', -1)),
('start_date', '<=', (Eval('end_period_cmp'), 'start_date'))
],
states={
'invisible': ~Eval('comparison', False),
})
end_period_cmp = fields.Many2One('account.period', 'End Period',
domain=[
('fiscalyear', '=', Eval('fiscalyear_cmp')),
('fiscalyear', '=', Eval('fiscalyear_cmp', -1)),
('start_date', '>=', (Eval('start_period_cmp'), 'start_date')),
],
states={
Expand Down Expand Up @@ -3069,15 +3069,15 @@ class CreateChartProperties(ModelView):
('closed', '!=', True),
('type.receivable', '=', True),
('party_required', '=', True),
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
])
account_payable = fields.Many2One('account.account',
'Default Payable Account',
domain=[
('closed', '!=', True),
('type.payable', '=', True),
('party_required', '=', True),
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
])


Expand Down
2 changes: 1 addition & 1 deletion modules/account/account.xml
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="context_model">account.general_ledger.account.context</field>
<field
name="domain"
eval="[If(Eval('active_ids', []) == [Eval('active_id')], ('account', '=', Eval('active_id')), ('account', 'in', Eval('active_ids')))]"
eval="[If(Eval('active_ids', []) == [Eval('active_id')], ('account', '=', Eval('active_id', -1)), ('account', 'in', Eval('active_ids')))]"
pyson="1"/>
</record>
<record model="ir.action.act_window.view" id="act_general_ledger_account_party_form_view1">
Expand Down
8 changes: 4 additions & 4 deletions modules/account/fiscalyear.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class FiscalYear(Workflow, ModelSQL, ModelView):
periods = fields.One2Many('account.period', 'fiscalyear', 'Periods',
states=STATES,
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
],
order=[('start_date', 'ASC'), ('id', 'ASC')])
state = fields.Selection([
Expand All @@ -47,7 +47,7 @@ class FiscalYear(Workflow, ModelSQL, ModelView):
domain=[
('sequence_type', '=',
Id('account', 'sequence_type_account_move')),
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
])
company = fields.Many2One(
'company.company', "Company", required=True)
Expand Down Expand Up @@ -407,7 +407,7 @@ class BalanceNonDeferralStart(ModelView):
depends={'company'})
period = fields.Many2One('account.period', 'Period', required=True,
domain=[
('fiscalyear', '=', Eval('fiscalyear')),
('fiscalyear', '=', Eval('fiscalyear', -1)),
('type', '=', 'adjustment'),
])
credit_account = fields.Many2One('account.account', 'Credit Account',
Expand Down Expand Up @@ -584,7 +584,7 @@ class RenewFiscalYearStart(ModelView):
previous_fiscalyear = fields.Many2One(
'account.fiscalyear', "Previous Fiscalyear", required=True,
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
],
help="Used as reference for fiscalyear configuration.")
start_date = fields.Date("Start Date", required=True)
Expand Down
10 changes: 5 additions & 5 deletions modules/account/move.py
Original file line number Diff line number Diff line change
Expand Up @@ -1747,14 +1747,14 @@ class WriteOff(DeactivableMixin, ModelSQL, ModelView):
domain=[
('type', '!=', None),
('closed', '!=', True),
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
])
debit_account = fields.Many2One('account.account', "Debit Account",
required=True,
domain=[
('type', '!=', None),
('closed', '!=', True),
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
])

@classmethod
Expand Down Expand Up @@ -1913,7 +1913,7 @@ class ReconcileLinesWriteOff(ModelView):
writeoff = fields.Many2One('account.move.reconcile.write_off', "Write Off",
required=True,
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
])
date = fields.Date('Date', required=True)
amount = Monetary(
Expand Down Expand Up @@ -2370,8 +2370,8 @@ class ReconcileShow(ModelView):
currency = fields.Many2One('currency.currency', "Currency", readonly=True)
lines = fields.Many2Many('account.move.line', None, None, 'Lines',
domain=[
('account', '=', Eval('account')),
('party', '=', Eval('party')),
('account', '=', Eval('account', -1)),
('party', '=', Eval('party', -1)),
('reconciliation', '=', None),
['OR',
[
Expand Down
12 changes: 6 additions & 6 deletions modules/account/tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ class TaxCodeLine(ModelSQL, ModelView):
tax = fields.Many2One(
'account.tax', "Tax", required=True, states=_states,
domain=[
('company', '=', Eval('_parent_code', {}).get('company')),
('company', '=', Eval('_parent_code', {}).get('company', -1)),
],
depends={'code'})
amount = fields.Selection([
Expand Down Expand Up @@ -819,7 +819,7 @@ class Tax(sequence_ordered(), ModelSQL, ModelView, DeactivableMixin):
credit_note_account = fields.Many2One('account.account',
'Credit Note Account',
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
('type.statement', '=', 'balance'),
('closed', '!=', True),
],
Expand Down Expand Up @@ -1580,7 +1580,7 @@ class TaxRuleLineTemplate(sequence_ordered(), ModelSQL, ModelView):
domain=[
('parent', '=', None),
('account', '=', Eval('_parent_rule', {}).get('account', 0)),
('group', '=', Eval('group')),
('group', '=', Eval('group', -1)),
['OR',
('group', '=', None),
If(Eval('_parent_rule', {}).get('kind', 'both') == 'sale',
Expand All @@ -1601,7 +1601,7 @@ class TaxRuleLineTemplate(sequence_ordered(), ModelSQL, ModelView):
domain=[
('parent', '=', None),
('account', '=', Eval('_parent_rule', {}).get('account', 0)),
('group', '=', Eval('group')),
('group', '=', Eval('group', -1)),
['OR',
('group', '=', None),
If(Eval('_parent_rule', {}).get('kind', 'both') == 'sale',
Expand Down Expand Up @@ -1701,7 +1701,7 @@ class TaxRuleLine(sequence_ordered(), ModelSQL, ModelView, MatchMixin):
origin_tax = fields.Many2One('account.tax', 'Original Tax',
domain=[
('parent', '=', None),
('company', '=', Eval('_parent_rule', {}).get('company')),
('company', '=', Eval('_parent_rule', {}).get('company', -1)),
('group', '=', Eval('group')),
['OR',
('group', '=', None),
Expand All @@ -1722,7 +1722,7 @@ class TaxRuleLine(sequence_ordered(), ModelSQL, ModelView, MatchMixin):
tax = fields.Many2One('account.tax', 'Substitution Tax',
domain=[
('parent', '=', None),
('company', '=', Eval('_parent_rule', {}).get('company')),
('company', '=', Eval('_parent_rule', {}).get('company', -1)),
('group', '=', Eval('group')),
['OR',
('group', '=', None),
Expand Down
4 changes: 2 additions & 2 deletions modules/account/tax.xml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">Taxes</field>
<field name="res_model">account.tax</field>
<field name="domain"
eval="[('company', '=', Eval('company')), ('parent', '=', None)]"
eval="[('company', '=', Eval('company', -1)), ('parent', '=', None)]"
pyson="1"/>
</record>
<record model="ir.action.act_window.view" id="act_tax_list_view1">
Expand Down Expand Up @@ -456,7 +456,7 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.action.act_window" id="act_tax_rule_form">
<field name="name">Rules</field>
<field name="res_model">account.tax.rule</field>
<field name="domain" eval="[('company', '=', Eval('company'))]"
<field name="domain" eval="[('company', '=', Eval('company', -1))]"
pyson="1"/>
</record>
<record model="ir.action.act_window.view" id="act_tax_rule_form_view1">
Expand Down
2 changes: 1 addition & 1 deletion modules/account_be/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class BEVATCustomerContext(ModelView):
fiscalyear = fields.Many2One(
'account.fiscalyear', "Fiscal Year", required=True,
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
])

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion modules/account_consolidation/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Invoice(metaclass=PoolMeta):
consolidation_company = fields.Many2One(
'company.company', "Consolidation Company",
domain=[
('party', '=', Eval('party')),
('party', '=', Eval('party', -1)),
],
states={
'readonly': Eval('state') != 'draft',
Expand Down
2 changes: 1 addition & 1 deletion modules/account_deposit/account.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="res_model">account.move.line</field>
<field
name="domain"
eval="[('account.type.deposit', '=', True), If(Eval('active_ids', []) == [Eval('active_id')], ('party', '=', Eval('active_id')), ('party', 'in', Eval('active_ids')))]"
eval="[('account.type.deposit', '=', True), If(Eval('active_ids', []) == [Eval('active_id')], ('party', '=', Eval('active_id', -1)), ('party', 'in', Eval('active_ids')))]"
pyson="1"/>
<field name="search_value" eval="[('reconciliation', '=', None)]" pyson="1"/>
<field name="order" eval="[('date', 'DESC')]" pyson="1"/>
Expand Down
6 changes: 3 additions & 3 deletions modules/account_es/reporting_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,16 +725,16 @@ class ESVATBookContext(ModelView):
fiscalyear = fields.Many2One('account.fiscalyear', "Fiscal Year",
required=True,
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
])
start_period = fields.Many2One('account.period', "Start Period",
domain=[
('fiscalyear', '=', Eval('fiscalyear')),
('fiscalyear', '=', Eval('fiscalyear', -1)),
('start_date', '<=', (Eval('end_period'), 'start_date')),
])
end_period = fields.Many2One('account.period', "End Period",
domain=[
('fiscalyear', '=', Eval('fiscalyear')),
('fiscalyear', '=', Eval('fiscalyear', -1)),
('start_date', '>=', (Eval('start_period'), 'start_date'))
])
es_vat_book_type = fields.Selection([
Expand Down
4 changes: 2 additions & 2 deletions modules/account_eu/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ class ECSalesListContext(ModelView):
fiscalyear = fields.Many2One(
'account.fiscalyear', "Fiscal Year", required=True,
domain=[
('company', '=', Eval('company')),
('company', '=', Eval('company', -1)),
])
period = fields.Many2One(
'account.period', "Period",
domain=[
('fiscalyear', '=', Eval('fiscalyear')),
('fiscalyear', '=', Eval('fiscalyear', -1)),
])

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion modules/account_fr/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ class FrFECStart(ModelView):
deferral_period = fields.Many2One(
'account.period', "Deferral Period", required=True,
domain=[
('fiscalyear', '=', Eval('fiscalyear')),
('fiscalyear', '=', Eval('fiscalyear', -1)),
('type', '=', 'adjustment'),
],
help="The period to exclude which contains "
Expand Down
Loading