forked from Yaltik/golem
Merge branch 'master' into resource_typo
This commit is contained in:
commit
8060d261e3
@ -19,7 +19,7 @@
|
||||
'name': 'GOLEM activities',
|
||||
'summary': 'Extends Odoo products for multi-activity',
|
||||
'description': 'Extends Odoo products for multi-activity',
|
||||
'version': '10.0.2.4.1',
|
||||
'version': '10.0.2.5.0',
|
||||
'category': 'GOLEM',
|
||||
'author': 'Fabien Bourgeois, Michel Dessenne',
|
||||
'license': 'AGPL-3',
|
||||
|
@ -17,7 +17,9 @@
|
||||
|
||||
""" GOLEM activities related models """
|
||||
|
||||
import logging
|
||||
from odoo import models, fields, api, _
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
class GolemActivityType(models.Model):
|
||||
""" GOLEM Activity Type """
|
||||
@ -201,3 +203,11 @@ class ProductTemplate(models.Model):
|
||||
type = fields.Selection(default='service')
|
||||
default_code = fields.Char(copy=True)
|
||||
categ_id = fields.Many2one(copy=True)
|
||||
|
||||
|
||||
class ProductCategory(models.Model):
|
||||
""" Product Category adaptations """
|
||||
_inherit = 'product.category'
|
||||
|
||||
property_account_income_categ_id = fields.Many2one(required=True)
|
||||
property_account_expense_categ_id = fields.Many2one(required=True)
|
||||
|
@ -19,7 +19,8 @@
|
||||
{
|
||||
'name': 'GOLEM members account',
|
||||
'summary': 'GOLEM non-profit members account',
|
||||
'version': '10.0.1.0.1',
|
||||
'description': 'GOLEM non-profit members account',
|
||||
'version': '10.0.1.1.0',
|
||||
'category': 'GOLEM',
|
||||
'author': 'Fabien Bourgeois, Michel Dessenne',
|
||||
'license': 'AGPL-3',
|
||||
|
@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-02-12 17:49+0000\n"
|
||||
"PO-Revision-Date: 2018-02-12 17:49+0000\n"
|
||||
"POT-Creation-Date: 2018-08-03 07:43+0000\n"
|
||||
"PO-Revision-Date: 2018-08-03 09:44+0200\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -20,6 +20,11 @@ msgstr ""
|
||||
msgid "<span class=\"o_stat_text\">Invoiced</span>"
|
||||
msgstr "<span class=\"o_stat_text\">Facturé</span>"
|
||||
|
||||
#. module: golem_member_account
|
||||
#: model:ir.ui.view,arch_db:golem_member_account.golem_member_form_inherit_golem_member_account
|
||||
msgid "<span class=\"o_stat_text\">Paid</span>"
|
||||
msgstr "<span class=\"o_stat_text\">Payé</span>"
|
||||
|
||||
#. module: golem_member_account
|
||||
#: selection:golem.member,last_payment_state:0
|
||||
msgid "Checked"
|
||||
@ -49,3 +54,9 @@ msgstr "Comptabilisé"
|
||||
#: selection:golem.member,last_payment_state:0
|
||||
msgid "Reconciled"
|
||||
msgstr "Lettré"
|
||||
|
||||
#. module: golem_member_account
|
||||
#: model:ir.model.fields,field_description:golem_member_account.field_golem_member_total_paid
|
||||
msgid "Total paid"
|
||||
msgstr "Total payé"
|
||||
|
||||
|
@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-02-12 17:50+0000\n"
|
||||
"PO-Revision-Date: 2018-02-12 17:50+0000\n"
|
||||
"POT-Creation-Date: 2018-08-03 07:43+0000\n"
|
||||
"PO-Revision-Date: 2018-08-03 07:43+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -20,6 +20,11 @@ msgstr ""
|
||||
msgid "<span class=\"o_stat_text\">Invoiced</span>"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_member_account
|
||||
#: model:ir.ui.view,arch_db:golem_member_account.golem_member_form_inherit_golem_member_account
|
||||
msgid "<span class=\"o_stat_text\">Paid</span>"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_member_account
|
||||
#: selection:golem.member,last_payment_state:0
|
||||
msgid "Checked"
|
||||
@ -50,3 +55,8 @@ msgstr ""
|
||||
msgid "Reconciled"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_member_account
|
||||
#: model:ir.model.fields,field_description:golem_member_account.field_golem_member_total_paid
|
||||
msgid "Total paid"
|
||||
msgstr ""
|
||||
|
||||
|
@ -25,22 +25,56 @@ class GolemMember(models.Model):
|
||||
""" GOLEM Member adaptations """
|
||||
_inherit = 'golem.member'
|
||||
|
||||
total_paid = fields.Monetary(compute='_compute_total_paid', store=True,
|
||||
groups='account.group_account_invoice')
|
||||
last_payment_state = fields.Selection([('draft', 'Draft'),
|
||||
('posted', 'Posted'),
|
||||
('checked', 'Checked'),
|
||||
('reconciled', 'Reconciled')],
|
||||
compute='_compute_last_payment_state')
|
||||
|
||||
@api.depends('invoice_ids.payment_ids', 'invoice_ids.payment_ids.state',
|
||||
'invoice_ids.payment_ids.amount')
|
||||
def _compute_total_paid(self):
|
||||
""" Computes total paid """
|
||||
for member in self:
|
||||
payments = member.invoice_ids.mapped('payment_ids')
|
||||
member.total_paid = sum(
|
||||
payments.filtered(lambda p: p.state != 'draft').mapped('amount')
|
||||
)
|
||||
|
||||
@api.multi
|
||||
def open_partner_invoices(self):
|
||||
""" Open member invoices """
|
||||
self.ensure_one()
|
||||
action = self.env.ref('account.action_invoice_tree1')
|
||||
context = {'type':'out_invoice', 'journal_type': 'sale',
|
||||
'search_default_partner_id': self[0].partner_id.id,
|
||||
'default_partner_id': self[0].partner_id.id}
|
||||
return {'type': 'ir.actions.act_window',
|
||||
'name': 'Invoices',
|
||||
'name': action.name,
|
||||
'res_model': 'account.invoice',
|
||||
'view_mode': 'tree,form',
|
||||
'context': {'search_default_partner_id': self[0].partner_id.id,
|
||||
'default_partner_id': self[0].partner_id.id}}
|
||||
'view_type': action.view_type,
|
||||
'view_mode': action.view_mode,
|
||||
'domain': action.domain,
|
||||
'context': context}
|
||||
|
||||
@api.multi
|
||||
def open_partner_payments(self):
|
||||
""" Open member payments """
|
||||
self.ensure_one()
|
||||
action = self.env.ref('account.action_account_payments')
|
||||
context = {'default_payment_type': 'inbound',
|
||||
'default_partner_type': 'customer',
|
||||
'search_default_partner_id': self[0].partner_id.id,
|
||||
'default_partner_id': self[0].partner_id.id}
|
||||
return {'type': 'ir.actions.act_window',
|
||||
'name': action.name,
|
||||
'res_model': 'account.payment',
|
||||
'view_type': action.view_type,
|
||||
'view_mode': action.view_mode,
|
||||
'domain': action.domain,
|
||||
'context': context}
|
||||
|
||||
@api.depends('invoice_ids')
|
||||
def _compute_last_payment_state(self):
|
||||
|
@ -27,6 +27,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="model">golem.member</field>
|
||||
<field name="inherit_id" ref="golem_member.golem_member_form" />
|
||||
<field name="arch" type="xml">
|
||||
<form position="inside">
|
||||
<field name="currency_id" invisible="1" />
|
||||
</form>
|
||||
<div name="buttons" position="inside">
|
||||
<button type="object" class="oe_stat_button" id="invoice_button"
|
||||
icon="fa-pencil-square-o" name="open_partner_invoices"
|
||||
@ -39,11 +42,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<span class="o_stat_text">Invoiced</span>
|
||||
</div>
|
||||
</button>
|
||||
<button type="object" class="oe_stat_button" id="payment_button"
|
||||
icon="fa-money" name="open_partner_payments"
|
||||
context="{'default_partner_id': active_id}">
|
||||
<div class="o_form_field o_stat_info">
|
||||
<span class="o_stat_value">
|
||||
<field name="total_paid" widget='monetary'
|
||||
options="{'currency_field': 'currency_id'}"/>
|
||||
</span>
|
||||
<span class="o_stat_text">Paid</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<field name="comment" position="before">
|
||||
<field name="last_payment_state" />
|
||||
<field name="currency_id" invisible="1" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
{
|
||||
'name': 'GOLEM non-profit membership handling',
|
||||
'summary': 'Extends Odoo membership',
|
||||
'version': '10.0.2.2.0',
|
||||
'version': '10.0.2.2.1',
|
||||
'category': 'GOLEM',
|
||||
'author': 'Fabien Bourgeois, Michel Dessenne',
|
||||
'license': 'AGPL-3',
|
||||
|
@ -27,7 +27,8 @@ class AccountConfig(models.AbstractModel):
|
||||
|
||||
@api.model
|
||||
def account_settings(self):
|
||||
""" Please use better default taxes and account.journal config """
|
||||
""" Please use better default taxes, account.journal config, base
|
||||
accounts for categories """
|
||||
account_conf_obj = self.env['account.config.settings']
|
||||
data = {'company_id': self.env.ref('base.main_company').id}
|
||||
account_conf = account_conf_obj.create(data)
|
||||
@ -53,3 +54,20 @@ class AccountConfig(models.AbstractModel):
|
||||
'default_debit_account_id': bank_journal.default_debit_account_id.id,
|
||||
'default_credit_account_id': bank_journal.default_credit_account_id.id
|
||||
})
|
||||
|
||||
# Default categories account to 706 and 604
|
||||
categories = (self.env.ref('product.product_category_all'),
|
||||
self.env.ref('product.product_category_1'))
|
||||
account_obj = self.env['account.account']
|
||||
income_account = account_obj.search([('code', '=', '706000')])
|
||||
expense_account = account_obj.search([('code', '=', '604000')])
|
||||
for categ in categories:
|
||||
categ.write({
|
||||
'property_account_income_categ_id': income_account.id,
|
||||
'property_account_expense_categ_id': expense_account.id
|
||||
})
|
||||
property_obj = self.env['ir.property']
|
||||
income = property_obj.search([('name', '=', 'property_account_income_categ_id')])
|
||||
income.write({'value_reference': 'account.account,%s' % income_account.id})
|
||||
expense = property_obj.search([('name', '=', 'property_account_expense_categ_id')])
|
||||
expense.write({'value_reference': 'account.account,%s' % expense_account.id})
|
||||
|
@ -20,7 +20,7 @@
|
||||
'summary': 'Usage of account invoice and account payments',
|
||||
'description': ''' Ability to create invoice(s) from activity subscriptions
|
||||
and anticipate multiple payments. ''',
|
||||
'version': '10.0.0.2.0',
|
||||
'version': '10.0.0.3.0',
|
||||
'category': 'GOLEM',
|
||||
'author': 'Fabien Bourgeois',
|
||||
'license': 'AGPL-3',
|
||||
|
@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-08-01 16:06+0000\n"
|
||||
"PO-Revision-Date: 2018-08-01 18:08+0200\n"
|
||||
"POT-Creation-Date: 2018-08-03 07:43+0000\n"
|
||||
"PO-Revision-Date: 2018-08-03 09:49+0200\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -67,6 +67,11 @@ msgstr "Jours"
|
||||
msgid "Display Name"
|
||||
msgstr "Nom affiché"
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search
|
||||
msgid "Draft"
|
||||
msgstr "Brouillon"
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.model,name:golem_payment.model_golem_payment_schedule
|
||||
msgid "GOLEM Payment Schedule"
|
||||
@ -120,7 +125,7 @@ msgstr "Échéanciers de paiements"
|
||||
#. module: golem_payment
|
||||
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search
|
||||
msgid "Payment delayed"
|
||||
msgstr "Paiement à venir"
|
||||
msgstr "Paiement en retard"
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.model.fields,field_description:golem_payment.field_account_payment_reference
|
||||
@ -132,6 +137,16 @@ msgstr "Référence paiement"
|
||||
msgid "Payments"
|
||||
msgstr "Paiements"
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search
|
||||
msgid "Post"
|
||||
msgstr "Comptabilisé"
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search
|
||||
msgid "Reconciled"
|
||||
msgstr "Lettré"
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.model.fields,field_description:golem_payment.field_golem_payment_schedule_day_schedule_id
|
||||
msgid "Schedule id"
|
||||
@ -143,6 +158,11 @@ msgstr "Échéancier"
|
||||
msgid "Season"
|
||||
msgstr "Saison"
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search
|
||||
msgid "Sent"
|
||||
msgstr "Envoyé"
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.model,name:golem_payment.model_golem_payment_schedule_day
|
||||
msgid "golem.payment.schedule.day"
|
||||
|
@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-08-01 16:06+0000\n"
|
||||
"PO-Revision-Date: 2018-08-01 16:06+0000\n"
|
||||
"POT-Creation-Date: 2018-08-03 07:43+0000\n"
|
||||
"PO-Revision-Date: 2018-08-03 07:43+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -67,6 +67,11 @@ msgstr ""
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search
|
||||
msgid "Draft"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.model,name:golem_payment.model_golem_payment_schedule
|
||||
msgid "GOLEM Payment Schedule"
|
||||
@ -132,6 +137,16 @@ msgstr ""
|
||||
msgid "Payments"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search
|
||||
msgid "Post"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search
|
||||
msgid "Reconciled"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.model.fields,field_description:golem_payment.field_golem_payment_schedule_day_schedule_id
|
||||
msgid "Schedule id"
|
||||
@ -143,6 +158,11 @@ msgstr ""
|
||||
msgid "Season"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search
|
||||
msgid "Sent"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_payment
|
||||
#: model:ir.model,name:golem_payment.model_golem_payment_schedule_day
|
||||
msgid "golem.payment.schedule.day"
|
||||
|
@ -63,15 +63,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="model">account.payment</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="partner_id" />
|
||||
<field name="state" />
|
||||
<field name="payment_date" />
|
||||
<field name="reference" />
|
||||
<group string="Group By">
|
||||
<filter name="group_week" string="By week"
|
||||
context="{'group_by': 'payment_date:week'}"/>
|
||||
<filter name="group_month" string="By month"
|
||||
context="{'group_by': 'payment_date:month'}"/>
|
||||
</group>
|
||||
<filter name="state_draft" string="Draft"
|
||||
domain="[('state', '=', 'draft')]" />
|
||||
<filter name="state_posted" string="Post"
|
||||
domain="[('state', '=', 'posted')]" />
|
||||
<filter name="state_sent" string="Sent"
|
||||
domain="[('state', '=', 'sent')]" />
|
||||
<filter name="state_reconciled" string="Reconciled"
|
||||
domain="[('state', '=', 'reconciled')]" />
|
||||
<separator />
|
||||
<filter name="payment_7_days" string="payment in 7 days"
|
||||
domain="[('state','=', 'draft'),
|
||||
('payment_date','<=', (context_today() + datetime.timedelta(days=7)).strftime('%Y-%m-%d')),
|
||||
@ -83,6 +87,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<separator />
|
||||
<filter name="payment_delayed" string="Payment delayed"
|
||||
domain="[('state','=', 'draft'), ('payment_date','<=', context_today().strftime('%Y-%m-%d'))]" />
|
||||
<group string="Group By">
|
||||
<filter name="group_week" string="By week"
|
||||
context="{'group_by': 'payment_date:week'}"/>
|
||||
<filter name="group_month" string="By month"
|
||||
context="{'group_by': 'payment_date:month'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
Loading…
Reference in New Issue
Block a user