Merge branch 'master' into resource_typo

This commit is contained in:
Fabien BOURGEOIS 2018-08-03 10:39:02 +02:00
commit 8060d261e3
13 changed files with 172 additions and 28 deletions

View File

@ -19,7 +19,7 @@
'name': 'GOLEM activities', 'name': 'GOLEM activities',
'summary': 'Extends Odoo products for multi-activity', 'summary': 'Extends Odoo products for multi-activity',
'description': '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', 'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne', 'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3', 'license': 'AGPL-3',

View File

@ -17,7 +17,9 @@
""" GOLEM activities related models """ """ GOLEM activities related models """
import logging
from odoo import models, fields, api, _ from odoo import models, fields, api, _
_LOGGER = logging.getLogger(__name__)
class GolemActivityType(models.Model): class GolemActivityType(models.Model):
""" GOLEM Activity Type """ """ GOLEM Activity Type """
@ -201,3 +203,11 @@ class ProductTemplate(models.Model):
type = fields.Selection(default='service') type = fields.Selection(default='service')
default_code = fields.Char(copy=True) default_code = fields.Char(copy=True)
categ_id = fields.Many2one(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)

View File

@ -19,7 +19,8 @@
{ {
'name': 'GOLEM members account', 'name': 'GOLEM members account',
'summary': 'GOLEM non-profit 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', 'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne', 'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3', 'license': 'AGPL-3',

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-12 17:49+0000\n" "POT-Creation-Date: 2018-08-03 07:43+0000\n"
"PO-Revision-Date: 2018-02-12 17:49+0000\n" "PO-Revision-Date: 2018-08-03 09:44+0200\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -20,6 +20,11 @@ msgstr ""
msgid "<span class=\"o_stat_text\">Invoiced</span>" msgid "<span class=\"o_stat_text\">Invoiced</span>"
msgstr "<span class=\"o_stat_text\">Facturé</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 #. module: golem_member_account
#: selection:golem.member,last_payment_state:0 #: selection:golem.member,last_payment_state:0
msgid "Checked" msgid "Checked"
@ -49,3 +54,9 @@ msgstr "Comptabilisé"
#: selection:golem.member,last_payment_state:0 #: selection:golem.member,last_payment_state:0
msgid "Reconciled" msgid "Reconciled"
msgstr "Lettré" 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é"

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-12 17:50+0000\n" "POT-Creation-Date: 2018-08-03 07:43+0000\n"
"PO-Revision-Date: 2018-02-12 17:50+0000\n" "PO-Revision-Date: 2018-08-03 07:43+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -20,6 +20,11 @@ msgstr ""
msgid "<span class=\"o_stat_text\">Invoiced</span>" msgid "<span class=\"o_stat_text\">Invoiced</span>"
msgstr "" 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 #. module: golem_member_account
#: selection:golem.member,last_payment_state:0 #: selection:golem.member,last_payment_state:0
msgid "Checked" msgid "Checked"
@ -50,3 +55,8 @@ msgstr ""
msgid "Reconciled" msgid "Reconciled"
msgstr "" msgstr ""
#. module: golem_member_account
#: model:ir.model.fields,field_description:golem_member_account.field_golem_member_total_paid
msgid "Total paid"
msgstr ""

View File

@ -25,22 +25,56 @@ class GolemMember(models.Model):
""" GOLEM Member adaptations """ """ GOLEM Member adaptations """
_inherit = 'golem.member' _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'), last_payment_state = fields.Selection([('draft', 'Draft'),
('posted', 'Posted'), ('posted', 'Posted'),
('checked', 'Checked'), ('checked', 'Checked'),
('reconciled', 'Reconciled')], ('reconciled', 'Reconciled')],
compute='_compute_last_payment_state') 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 @api.multi
def open_partner_invoices(self): def open_partner_invoices(self):
""" Open member invoices """ """ Open member invoices """
self.ensure_one() 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', return {'type': 'ir.actions.act_window',
'name': 'Invoices', 'name': action.name,
'res_model': 'account.invoice', 'res_model': 'account.invoice',
'view_mode': 'tree,form', 'view_type': action.view_type,
'context': {'search_default_partner_id': self[0].partner_id.id, 'view_mode': action.view_mode,
'default_partner_id': self[0].partner_id.id}} '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') @api.depends('invoice_ids')
def _compute_last_payment_state(self): def _compute_last_payment_state(self):

View File

@ -27,6 +27,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="model">golem.member</field> <field name="model">golem.member</field>
<field name="inherit_id" ref="golem_member.golem_member_form" /> <field name="inherit_id" ref="golem_member.golem_member_form" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<form position="inside">
<field name="currency_id" invisible="1" />
</form>
<div name="buttons" position="inside"> <div name="buttons" position="inside">
<button type="object" class="oe_stat_button" id="invoice_button" <button type="object" class="oe_stat_button" id="invoice_button"
icon="fa-pencil-square-o" name="open_partner_invoices" 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> <span class="o_stat_text">Invoiced</span>
</div> </div>
</button> </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> </div>
<field name="comment" position="before">
<field name="last_payment_state" />
<field name="currency_id" invisible="1" />
</field>
</field> </field>
</record> </record>

View File

@ -18,7 +18,7 @@
{ {
'name': 'GOLEM non-profit membership handling', 'name': 'GOLEM non-profit membership handling',
'summary': 'Extends Odoo membership', 'summary': 'Extends Odoo membership',
'version': '10.0.2.2.0', 'version': '10.0.2.2.1',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne', 'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3', 'license': 'AGPL-3',

View File

@ -27,7 +27,8 @@ class AccountConfig(models.AbstractModel):
@api.model @api.model
def account_settings(self): 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'] account_conf_obj = self.env['account.config.settings']
data = {'company_id': self.env.ref('base.main_company').id} data = {'company_id': self.env.ref('base.main_company').id}
account_conf = account_conf_obj.create(data) 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_debit_account_id': bank_journal.default_debit_account_id.id,
'default_credit_account_id': bank_journal.default_credit_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})

View File

@ -20,7 +20,7 @@
'summary': 'Usage of account invoice and account payments', 'summary': 'Usage of account invoice and account payments',
'description': ''' Ability to create invoice(s) from activity subscriptions 'description': ''' Ability to create invoice(s) from activity subscriptions
and anticipate multiple payments. ''', and anticipate multiple payments. ''',
'version': '10.0.0.2.0', 'version': '10.0.0.3.0',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Fabien Bourgeois', 'author': 'Fabien Bourgeois',
'license': 'AGPL-3', 'license': 'AGPL-3',

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-01 16:06+0000\n" "POT-Creation-Date: 2018-08-03 07:43+0000\n"
"PO-Revision-Date: 2018-08-01 18:08+0200\n" "PO-Revision-Date: 2018-08-03 09:49+0200\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -67,6 +67,11 @@ msgstr "Jours"
msgid "Display Name" msgid "Display Name"
msgstr "Nom affiché" msgstr "Nom affiché"
#. module: golem_payment
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search
msgid "Draft"
msgstr "Brouillon"
#. module: golem_payment #. module: golem_payment
#: model:ir.model,name:golem_payment.model_golem_payment_schedule #: model:ir.model,name:golem_payment.model_golem_payment_schedule
msgid "GOLEM Payment Schedule" msgid "GOLEM Payment Schedule"
@ -120,7 +125,7 @@ msgstr "Échéanciers de paiements"
#. module: golem_payment #. module: golem_payment
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search #: model:ir.ui.view,arch_db:golem_payment.account_payment_search
msgid "Payment delayed" msgid "Payment delayed"
msgstr "Paiement à venir" msgstr "Paiement en retard"
#. module: golem_payment #. module: golem_payment
#: model:ir.model.fields,field_description:golem_payment.field_account_payment_reference #: model:ir.model.fields,field_description:golem_payment.field_account_payment_reference
@ -132,6 +137,16 @@ msgstr "Référence paiement"
msgid "Payments" msgid "Payments"
msgstr "Paiements" 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 #. module: golem_payment
#: model:ir.model.fields,field_description:golem_payment.field_golem_payment_schedule_day_schedule_id #: model:ir.model.fields,field_description:golem_payment.field_golem_payment_schedule_day_schedule_id
msgid "Schedule id" msgid "Schedule id"
@ -143,6 +158,11 @@ msgstr "Échéancier"
msgid "Season" msgid "Season"
msgstr "Saison" msgstr "Saison"
#. module: golem_payment
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search
msgid "Sent"
msgstr "Envoyé"
#. module: golem_payment #. module: golem_payment
#: model:ir.model,name:golem_payment.model_golem_payment_schedule_day #: model:ir.model,name:golem_payment.model_golem_payment_schedule_day
msgid "golem.payment.schedule.day" msgid "golem.payment.schedule.day"

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-01 16:06+0000\n" "POT-Creation-Date: 2018-08-03 07:43+0000\n"
"PO-Revision-Date: 2018-08-01 16:06+0000\n" "PO-Revision-Date: 2018-08-03 07:43+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -67,6 +67,11 @@ msgstr ""
msgid "Display Name" msgid "Display Name"
msgstr "" msgstr ""
#. module: golem_payment
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search
msgid "Draft"
msgstr ""
#. module: golem_payment #. module: golem_payment
#: model:ir.model,name:golem_payment.model_golem_payment_schedule #: model:ir.model,name:golem_payment.model_golem_payment_schedule
msgid "GOLEM Payment Schedule" msgid "GOLEM Payment Schedule"
@ -132,6 +137,16 @@ msgstr ""
msgid "Payments" msgid "Payments"
msgstr "" 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 #. module: golem_payment
#: model:ir.model.fields,field_description:golem_payment.field_golem_payment_schedule_day_schedule_id #: model:ir.model.fields,field_description:golem_payment.field_golem_payment_schedule_day_schedule_id
msgid "Schedule id" msgid "Schedule id"
@ -143,6 +158,11 @@ msgstr ""
msgid "Season" msgid "Season"
msgstr "" msgstr ""
#. module: golem_payment
#: model:ir.ui.view,arch_db:golem_payment.account_payment_search
msgid "Sent"
msgstr ""
#. module: golem_payment #. module: golem_payment
#: model:ir.model,name:golem_payment.model_golem_payment_schedule_day #: model:ir.model,name:golem_payment.model_golem_payment_schedule_day
msgid "golem.payment.schedule.day" msgid "golem.payment.schedule.day"

View File

@ -63,15 +63,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="model">account.payment</field> <field name="model">account.payment</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<search> <search>
<field name="partner_id" />
<field name="state" /> <field name="state" />
<field name="payment_date" /> <field name="payment_date" />
<field name="reference" /> <field name="reference" />
<group string="Group By"> <filter name="state_draft" string="Draft"
<filter name="group_week" string="By week" domain="[('state', '=', 'draft')]" />
context="{'group_by': 'payment_date:week'}"/> <filter name="state_posted" string="Post"
<filter name="group_month" string="By month" domain="[('state', '=', 'posted')]" />
context="{'group_by': 'payment_date:month'}"/> <filter name="state_sent" string="Sent"
</group> domain="[('state', '=', 'sent')]" />
<filter name="state_reconciled" string="Reconciled"
domain="[('state', '=', 'reconciled')]" />
<separator />
<filter name="payment_7_days" string="payment in 7 days" <filter name="payment_7_days" string="payment in 7 days"
domain="[('state','=', 'draft'), domain="[('state','=', 'draft'),
('payment_date','&lt;=', (context_today() + datetime.timedelta(days=7)).strftime('%Y-%m-%d')), ('payment_date','&lt;=', (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 /> <separator />
<filter name="payment_delayed" string="Payment delayed" <filter name="payment_delayed" string="Payment delayed"
domain="[('state','=', 'draft'), ('payment_date','&lt;=', context_today().strftime('%Y-%m-%d'))]" /> domain="[('state','=', 'draft'), ('payment_date','&lt;=', 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> </search>
</field> </field>
</record> </record>