Browse Source

Merge pull request #101 from coopiteasy/12.0-get-journal

[IMP] emc: get journal by xml id rather than code
pull/103/head
Robin Keunen 5 years ago
committed by GitHub
parent
commit
8ebb1470b3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      easy_my_coop/demo/coop.xml
  2. 2
      easy_my_coop/models/coop.py

4
easy_my_coop/demo/coop.xml

@ -76,6 +76,10 @@
<field name="reconcile" eval="True"/> <field name="reconcile" eval="True"/>
</record> </record>
<record id="base.main_company" model="res.company">
<field name="property_cooperator_account" ref="account_cooperator_demo"/>
</record>
<record id="base.main_company" model="res.company"> <record id="base.main_company" model="res.company">
<field name="property_cooperator_account" <field name="property_cooperator_account"
ref="account_cooperator_demo"/> ref="account_cooperator_demo"/>

2
easy_my_coop/models/coop.py

@ -512,7 +512,7 @@ class SubscriptionRequest(models.Model):
invoice.sent = True invoice.sent = True
def get_journal(self): def get_journal(self):
return self.env["account.journal"].search([("code", "=", "SUBJ")])[0]
return self.env.ref("easy_my_coop.subscription_journal")
def get_accounting_account(self): def get_accounting_account(self):
account_obj = self.env["account.account"] account_obj = self.env["account.account"]

Loading…
Cancel
Save