Compare commits
23 Commits
9.0
...
8.0-improv
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51fa6f018e | ||
|
|
3888495071 | ||
|
|
93acac8e19 | ||
|
|
44b32672e2 | ||
|
|
1160cce1d8 | ||
|
|
16664bcb7f | ||
|
|
cfb92ec23a | ||
|
|
a3844004fb | ||
|
|
9319b120bf | ||
|
|
7fd5ab9cf1 | ||
|
|
8f463db179 | ||
|
|
f8720c7a36 | ||
|
|
e74e53c804 | ||
|
|
5388638941 | ||
|
|
d943ef262f | ||
|
|
a787e092ed | ||
|
|
8e5f0b0afa | ||
|
|
cb21028a48 | ||
|
|
ffa6e74a19 | ||
|
|
1e062af883 | ||
|
|
31f191aecb | ||
|
|
51c982bf2f | ||
|
|
3d7241407e |
@@ -1,3 +1,4 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
from . import account
|
||||
from . import wizard
|
||||
|
||||
@@ -49,6 +49,9 @@ This module has been written by Alexis de Lattre from Akretion <alexis.delattre@
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'conflicts': ['account_invoice_overdue_filter'],
|
||||
'data': ['account_view.xml'],
|
||||
'data': [
|
||||
'account_view.xml',
|
||||
'wizard/account_invoice_mark_sent_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class AccountInvoice(models.Model):
|
||||
_inherit = 'account.invoice'
|
||||
_order = "date_invoice desc, number desc, id desc"
|
||||
|
||||
origin = fields.Char(track_visibility='onchange')
|
||||
supplier_invoice_number = fields.Char(track_visibility='onchange')
|
||||
@@ -43,6 +44,37 @@ class AccountInvoice(models.Model):
|
||||
journal_id = fields.Many2one(track_visibility='onchange')
|
||||
partner_bank_id = fields.Many2one(track_visibility='onchange')
|
||||
fiscal_position = fields.Many2one(track_visibility='onchange')
|
||||
# has_attachment is useful for those who use attachment to archive
|
||||
# supplier invoices. It allows them to find supplier invoices
|
||||
# that don't have any attachment
|
||||
has_attachment = fields.Boolean(
|
||||
compute='_compute_has_attachment',
|
||||
search='_search_has_attachment', readonly=True)
|
||||
|
||||
@api.multi
|
||||
def _compute_has_attachment(self):
|
||||
iao = self.env['ir.attachment']
|
||||
for inv in self:
|
||||
if iao.search([
|
||||
('res_model', '=', 'account.invoice'),
|
||||
('res_id', '=', inv.id),
|
||||
('type', '=', 'binary'),
|
||||
('company_id', '=', inv.company_id.id)], limit=1):
|
||||
inv.has_attachment = True
|
||||
else:
|
||||
inv.has_attachment = False
|
||||
|
||||
def _search_has_attachment(self, operator, value):
|
||||
att_inv_ids = {}
|
||||
if operator == '=':
|
||||
search_res = self.env['ir.attachment'].search_read([
|
||||
('res_model', '=', 'account.invoice'),
|
||||
('type', '=', 'binary'),
|
||||
('res_id', '!=', False)], ['res_id'])
|
||||
for att in search_res:
|
||||
att_inv_ids[att['res_id']] = True
|
||||
res = [('id', value and 'in' or 'not in', att_inv_ids.keys())]
|
||||
return res
|
||||
|
||||
@api.multi
|
||||
def onchange_payment_term_date_invoice(
|
||||
@@ -130,6 +162,21 @@ class AccountAccount(models.Model):
|
||||
else:
|
||||
return super(AccountAccount, self).name_get()
|
||||
|
||||
def _check_account_type(self, cr, uid, ids, context=None):
|
||||
'''Disable this native python constraint, because we want to be able
|
||||
to configure payable/receivable accounts with an account type
|
||||
with close_method == 'balance' in order to have opening entries with
|
||||
fewer lines. It is not a problem because we always use
|
||||
account_financial_report_webkit which doesn't take the detailed
|
||||
opening entries into account.'''
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
# The method name must be exactly the same as the native
|
||||
# method, in order to override it
|
||||
(_check_account_type, 'No error message', ['user_type', 'type']),
|
||||
]
|
||||
|
||||
@api.model
|
||||
def check_account_hierarchy(self):
|
||||
'''designed to be called by a script'''
|
||||
@@ -183,6 +230,10 @@ class AccountMove(models.Model):
|
||||
# update account_move set ref=left(ref,32) where ref is not null;
|
||||
# update account_move_line set ref=left(ref,32) where ref is not null;
|
||||
|
||||
# Allow to duplicate an account.move that belongs to a closed period
|
||||
period_id = fields.Many2one(copy=False)
|
||||
date = fields.Date(copy=False)
|
||||
|
||||
@api.onchange('date')
|
||||
def date_onchange(self):
|
||||
if self.date:
|
||||
|
||||
@@ -38,6 +38,11 @@
|
||||
<field name="period_id" position="attributes">
|
||||
<attribute name="groups"></attribute>
|
||||
</field>
|
||||
<!-- move sent field and make it visible -->
|
||||
<field name="sent" position="replace"/>
|
||||
<field name="move_id" position="after">
|
||||
<field name="sent"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -61,6 +66,11 @@
|
||||
<filter name="unpaid" position="after">
|
||||
<filter name="overdue" string="Overdue"
|
||||
domain="[('state', '=', 'open'), ('date_due', '<', current_date)]"/>
|
||||
<separator/>
|
||||
<filter name="to_send" string="To Send" domain="[('sent', '=', False), ('state', 'in', ('open', 'paid'))]"/>
|
||||
<filter name="sent" string="Sent" domain="[('sent', '=', True)]"/>
|
||||
<separator/>
|
||||
<filter name="no_attachment" string="Missing Attachment" domain="[('has_attachment', '=', False)]"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
@@ -180,10 +190,24 @@ module -->
|
||||
<!-- model account.move.line / Journal Items -->
|
||||
<record id="account.action_account_moves_all_a" model="ir.actions.act_window">
|
||||
<field name="limit">200</field>
|
||||
<!-- add graph -->
|
||||
<field name="view_mode">tree_account_move_line_quickadd,form,graph</field>
|
||||
<!-- Win space, because there are already many columns -->
|
||||
<field name="context">{'journal_show_code_only': True}</field>
|
||||
</record>
|
||||
|
||||
<record id="account_move_line_graph" model="ir.ui.view">
|
||||
<field name="name">usability.account.move.line.graph</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.account_move_line_graph"/>
|
||||
<field name="arch" type="xml">
|
||||
<graph position="attributes">
|
||||
<!-- pivot by default instead of bar -->
|
||||
<attribute name="type">pivot</attribute>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- model account.move / Journal Entries -->
|
||||
<record id="account.action_move_journal_line" model="ir.actions.act_window">
|
||||
<field name="limit">200</field>
|
||||
@@ -293,9 +317,10 @@ module -->
|
||||
</button>
|
||||
</button>
|
||||
<button name="%(account.action_account_moves_all_tree)d" position="attributes">
|
||||
<attribute name="type">object</attribute>
|
||||
<attribute name="name">show_receivable_account</attribute>
|
||||
<attribute name="attrs">{'invisible': [('customer', '=', False)]}</attribute>
|
||||
<attribute name="invisible">True</attribute>
|
||||
</button>
|
||||
<button name="%(account.action_account_moves_all_tree)d" position="after">
|
||||
<button type="object" class="oe_stat_button" name="show_receivable_account" icon="fa-list" attrs="{'invisible': [('customer', '=', False)]}"/>
|
||||
</button>
|
||||
<field name="journal_item_count" position="attributes">
|
||||
<attribute name="string">Receivable Account</attribute>
|
||||
|
||||
3
account_usability/wizard/__init__.py
Normal file
3
account_usability/wizard/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
from . import account_invoice_mark_sent
|
||||
23
account_usability/wizard/account_invoice_mark_sent.py
Normal file
23
account_usability/wizard/account_invoice_mark_sent.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, api
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AccountInvoiceMarkSent(models.TransientModel):
|
||||
_name = 'account.invoice.mark.sent'
|
||||
_description = 'Mark invoices as sent'
|
||||
|
||||
@api.multi
|
||||
def run(self):
|
||||
assert self.env.context.get('active_model') == 'account.invoice',\
|
||||
'Source model must be invoices'
|
||||
assert self.env.context.get('active_ids'), 'No invoices selected'
|
||||
invoices = self.env['account.invoice'].browse(
|
||||
self.env.context.get('active_ids'))
|
||||
invoices.write({'sent': True})
|
||||
logger.info('Marking invoices with ID %s as sent', invoices.ids)
|
||||
return
|
||||
36
account_usability/wizard/account_invoice_mark_sent_view.xml
Normal file
36
account_usability/wizard/account_invoice_mark_sent_view.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="account_invoice_mark_sent_form" model="ir.ui.view">
|
||||
<field name="name">account.invoice.mark.sent.form</field>
|
||||
<field name="model">account.invoice.mark.sent</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Mark invoices as sent">
|
||||
<p>
|
||||
This wizard will mark as sent all the selected invoices.
|
||||
</p>
|
||||
<footer>
|
||||
<button type="object" name="run" string="Mark as Sent" class="oe_highlight"/>
|
||||
<button special="cancel" string="Cancel" class="oe_link"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window id="account_invoice_mark_sent_action"
|
||||
multi="True"
|
||||
key2="client_action_multi"
|
||||
name="Mark as Sent"
|
||||
res_model="account.invoice.mark.sent"
|
||||
src_model="account.invoice"
|
||||
view_mode="form"
|
||||
target="new" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -7,8 +7,45 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<record id="product_attribute_view_form" model="ir.ui.view">
|
||||
<field name="model">product.attribute</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Product Attribute">
|
||||
<sheet>
|
||||
<div class="oe_title" style="width: 390px;">
|
||||
<label class="oe_edit_only" for="name" string="Product Name"/>
|
||||
<h1><field name="name" class="oe_inline"/></h1>
|
||||
</div>
|
||||
<group>
|
||||
<field name="value_ids" colspan="4" nolabel="1"
|
||||
context="{'hide_attribute_id': True}"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="attribute_tree_view" model="ir.ui.view">
|
||||
<field name="model">product.attribute</field>
|
||||
<field name="inherit_id" ref="product.attribute_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree" position="attributes">
|
||||
<attribute name="editable"></attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="variants_tree_view" model="ir.ui.view">
|
||||
<field name="model">product.attribute.value</field>
|
||||
<field name="inherit_id" ref="product.variants_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="attribute_id" position="attributes">
|
||||
<attribute name="invisible">context.get('hide_attribute_id')</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product.attribute_action" model="ir.actions.act_window">
|
||||
<field name="res_model">product.attribute</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
<field name="model">ir.module.module</field>
|
||||
<field name="inherit_id" ref="base.view_module_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//filter[@name='extra']" position="after">
|
||||
<filter name="installable" string="Installable" domain="[('state', '!=', 'uninstallable')]"/>
|
||||
</xpath>
|
||||
<xpath expr="//filter[@string='Category']" position="after">
|
||||
<filter string="State" domain="[]" context="{'group_by':'state'}"/>
|
||||
</xpath>
|
||||
@@ -20,7 +23,7 @@
|
||||
|
||||
<record id="base.open_module_tree" model="ir.actions.act_window">
|
||||
<field name="res_model">ir.module.module</field>
|
||||
<field name="context">{}</field>
|
||||
<field name="context">{'search_default_installable': 1}</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
@@ -60,3 +60,21 @@ class Partner(models.Model):
|
||||
else:
|
||||
name_title = ' '.join([title, name_title])
|
||||
self.name_title = name_title
|
||||
|
||||
@api.model
|
||||
def name_search(self, name, args=None, operator='ilike', limit=100):
|
||||
if args is None:
|
||||
args = []
|
||||
if name:
|
||||
# only filter on name and ref not in email
|
||||
args += [
|
||||
'|', ('display_name', 'ilike', name), ('ref', 'ilike', name)]
|
||||
res = super(Partner, self).name_search(
|
||||
name, args=args, operator=operator, limit=limit)
|
||||
return [(pid, val.replace('\n', ' ')) for pid, val in res]
|
||||
|
||||
|
||||
class ResPartnerCategory(models.Model):
|
||||
_inherit = 'res.partner.category'
|
||||
|
||||
name = fields.Char(translate=False)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import wizard
|
||||
from . import crm
|
||||
|
||||
12
crm_usability/crm.py
Normal file
12
crm_usability/crm.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
|
||||
from openerp import models, fields
|
||||
|
||||
|
||||
class CrmCaseCateg(models.Model):
|
||||
_inherit = 'crm.case.categ'
|
||||
|
||||
name = fields.Char(translate=False)
|
||||
1
delivery_usability/__init__.py
Normal file
1
delivery_usability/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
30
delivery_usability/__openerp__.py
Normal file
30
delivery_usability/__openerp__.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Akretion (http://www.akretion.com).
|
||||
# @author Sébastien BEAU <sebastien.beau@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Delivery usability",
|
||||
"summary": "Delivery Usability",
|
||||
"version": "8.0.1.0.0",
|
||||
"category": "Warehouse",
|
||||
"website": "www.akretion.com",
|
||||
"author": " Akretion",
|
||||
"license": "AGPL-3",
|
||||
"application": False,
|
||||
"installable": True,
|
||||
"external_dependencies": {
|
||||
"python": [],
|
||||
"bin": [],
|
||||
},
|
||||
"depends": [
|
||||
"delivery",
|
||||
],
|
||||
"data": [
|
||||
"views/stock_picking_view.xml",
|
||||
],
|
||||
"demo": [
|
||||
],
|
||||
"qweb": [
|
||||
]
|
||||
}
|
||||
20
delivery_usability/views/stock_picking_view.xml
Normal file
20
delivery_usability/views/stock_picking_view.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_picking_withcarrier_out_form" model="ir.ui.view">
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="delivery.view_picking_withcarrier_out_form"/>
|
||||
<field name="priority" eval="100"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='carrier_id']/.." position="replace">
|
||||
</xpath>
|
||||
<field name="backorder_id" position="after">
|
||||
<field name="carrier_id"/>
|
||||
<field name="carrier_tracking_ref"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
from openerp import models, fields, api, _
|
||||
from openerp.exceptions import Warning as UserError
|
||||
from openerp.tools import float_is_zero
|
||||
|
||||
|
||||
class LunchVoucherPurchase(models.TransientModel):
|
||||
@@ -15,6 +16,8 @@ class LunchVoucherPurchase(models.TransientModel):
|
||||
self.ensure_one()
|
||||
action = super(LunchVoucherPurchase, self).run()
|
||||
company = self.env.user.company_id
|
||||
# force_company to read standard_price properly
|
||||
company = company.with_context(force_company=company.id)
|
||||
lvao = self.env['lunch.voucher.attribution']
|
||||
assert self._context.get('active_model')\
|
||||
== 'lunch.voucher.attribution', 'wrong source model'
|
||||
@@ -37,10 +40,18 @@ class LunchVoucherPurchase(models.TransientModel):
|
||||
"Natixis Delivery Code on company '%s' should "
|
||||
"have 7 characters/digits.")
|
||||
% (company.lunch_voucher_natixis_delivery_code, company.name))
|
||||
if not company.lunch_voucher_employer_price:
|
||||
if float_is_zero(
|
||||
company.lunch_voucher_employer_price,
|
||||
precision_digits=2):
|
||||
raise UserError(_(
|
||||
"Lunch Voucher Employer Price not set on company '%s'.")
|
||||
% company.name)
|
||||
if float_is_zero(
|
||||
company.lunch_voucher_product_id.standard_price,
|
||||
precision_digits=2):
|
||||
raise UserError(_(
|
||||
"Lunch Voucher Standard Price is not set on product '%s'.")
|
||||
% company.lunch_voucher_product_id.display_name)
|
||||
lvouchers = lvao.browse(self._context['active_ids'])
|
||||
of = u''
|
||||
tmp = {}
|
||||
|
||||
@@ -74,9 +74,11 @@ class HrHolidaysPost(models.TransientModel):
|
||||
# because, after the write, it doesn't have a value any more !!!
|
||||
holidays_to_post = self.holidays_to_post_ids
|
||||
today = fields.Date.context_today(self)
|
||||
if not self.holidays_to_post_ids:
|
||||
raise Warning(
|
||||
_('No leave request to post.'))
|
||||
# Disable the raise below to make the module "hr_holidays_lunch_voucher"
|
||||
# work even when nobody took holidays on the current month
|
||||
# if not self.holidays_to_post_ids:
|
||||
# raise Warning(
|
||||
# _('No leave request to post.'))
|
||||
self.holidays_to_post_ids.write({'posted_date': today})
|
||||
view_id = self.env.ref('hr_holidays_usability.hr_holiday_graph').id
|
||||
action = {
|
||||
|
||||
Binary file not shown.
@@ -42,6 +42,6 @@ Small usability improvements on mails:
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['mail'],
|
||||
'data': [],
|
||||
'data': ['views/mail.xml'],
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
92
mail_usability/static/src/js/many2many_tags_email.js
Normal file
92
mail_usability/static/src/js/many2many_tags_email.js
Normal file
@@ -0,0 +1,92 @@
|
||||
openerp_FieldMany2ManyTagsEmail = function(instance) {
|
||||
var _t = instance.web._t;
|
||||
|
||||
/**
|
||||
* Extend of FieldMany2ManyTags widget method.
|
||||
* When the user add a partner and the partner don't have an email, open a popup to purpose to add an email.
|
||||
* The user can choose to add an email or cancel and close the popup.
|
||||
*/
|
||||
instance.web.form.FieldMany2ManyTagsEmail = instance.web.form.FieldMany2ManyTags.extend({
|
||||
|
||||
start: function() {
|
||||
this.mutex = new openerp.Mutex();
|
||||
|
||||
// This widget will indirectly trigger a change:value to it's parent widget
|
||||
// when setting the value of valid partners. For this reason we have to keep an
|
||||
// internal state of the last value in order to compute the effective value changes.
|
||||
this.last_processed_value = [];
|
||||
|
||||
this.on("change:value", this, this.on_change_value_check);
|
||||
// Restore pop-up when trying to send to a partner without email
|
||||
this.on_change_value_check();
|
||||
this._super.apply(this, arguments);
|
||||
},
|
||||
|
||||
on_change_value_check : function () {
|
||||
var self = this;
|
||||
var values = this.get('value').slice(0); // Clone the array
|
||||
|
||||
// We only validate partners emails in case the value is not empty
|
||||
// and is different from the last processed value
|
||||
var effective_change = _.difference(values, self.last_processed_value).length;
|
||||
if (values.length && effective_change) {
|
||||
this.mutex.exec(function() {
|
||||
return self._check_email_popup(values);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_check_email_popup: function (ids) {
|
||||
var self = this;
|
||||
var valid_partners;
|
||||
|
||||
new instance.web.Model('res.partner').call("search", [[
|
||||
["id", "in", ids],
|
||||
["email", "=", false],
|
||||
["notify_email", "in", ['always', 'all_except_notification']]]],
|
||||
{context: this.build_context()})
|
||||
.then(function (record_ids) {
|
||||
var popups_deferreds = [];
|
||||
self.valid_partners = _.difference(ids, record_ids);
|
||||
|
||||
// Propose the user to correct invalid partners
|
||||
_.each(record_ids, function (id) {
|
||||
var popup_def = $.Deferred();
|
||||
popups_deferreds.push(popup_def);
|
||||
|
||||
var pop = new instance.web.form.FormOpenPopup(self);
|
||||
pop.show_element(
|
||||
'res.partner',
|
||||
id,
|
||||
self.build_context(),
|
||||
{
|
||||
title: _t("Please complete partner's informations and Email"),
|
||||
}
|
||||
);
|
||||
pop.on('write_completed', self, function () {
|
||||
self.valid_partners.push(id);
|
||||
});
|
||||
pop.on('closed', self, function () {
|
||||
popup_def.resolve();
|
||||
});
|
||||
});
|
||||
return $.when.apply($, popups_deferreds).then(function() {
|
||||
// All popups have been processed for the given ids
|
||||
// It is now time to set the final value with valid partners ids.
|
||||
var filtered_value = _.uniq(self.valid_partners);
|
||||
self.last_processed_value = filtered_value;
|
||||
self.set({'value': filtered_value});
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Registry of form fields
|
||||
*/
|
||||
instance.web.form.widgets = instance.web.form.widgets.extend({
|
||||
'many2many_tags_email' : 'instance.web.form.FieldMany2ManyTagsEmail',
|
||||
});
|
||||
|
||||
};
|
||||
11
mail_usability/views/mail.xml
Normal file
11
mail_usability/views/mail.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
<template id="assets_backend" name="mail usability assets" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/mail_usability/static/src/js/many2many_tags_email.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -40,31 +40,27 @@ class ResPartner(models.Model):
|
||||
def open_aged_open_invoices_report(self):
|
||||
aoiwo = self.env['aged.open.invoices.webkit']
|
||||
afo = self.env['account.fiscalyear']
|
||||
# Force 'date_from' to the first day of the company's life
|
||||
# in order to get the full picture of the partner's account
|
||||
# (we could also do that via a filter by period, but, in this case,
|
||||
# account_financial_report_webkit doesn't accept "until_date = today" ;
|
||||
# until_date has to be the end date of the last period
|
||||
# Filter by period (and not by date) to get
|
||||
# the report à nouveau
|
||||
fy_years = afo.search([], order='date_start')
|
||||
date_from = fy_years[0].date_start
|
||||
fy_id = aoiwo._get_fiscalyear()
|
||||
filter_change = aoiwo.onchange_filter(
|
||||
filter='filter_date', fiscalyear_id=fy_id)
|
||||
filter='filter_period', fiscalyear_id=fy_id)
|
||||
vals = {
|
||||
'fiscalyear_id': fy_id,
|
||||
'filter': 'filter_date',
|
||||
'filter': 'filter_period',
|
||||
'partner_ids': [(6, 0, [self.commercial_partner_id.id])],
|
||||
'target_move': 'all',
|
||||
}
|
||||
vals.update(filter_change['value'])
|
||||
vals['date_from'] = date_from
|
||||
wizard = aoiwo.create(vals)
|
||||
data = {'form': {
|
||||
'chart_account_id': wizard.chart_account_id.id,
|
||||
'filter': vals['filter'],
|
||||
'date_from': vals['date_from'],
|
||||
'date_to': vals['date_to'],
|
||||
'period_to': False,
|
||||
'period_from': vals['period_from'],
|
||||
'period_to': vals['period_to'],
|
||||
'date_to': False,
|
||||
'fiscalyear_id': vals['fiscalyear_id'],
|
||||
'partner_ids': vals['partner_ids'][0][2],
|
||||
'target_move': vals['target_move'],
|
||||
|
||||
@@ -14,10 +14,20 @@
|
||||
<field name="phone" string="Phones"
|
||||
filter_domain="['|', ('phone', 'like', self), ('mobile', 'like', self)]"/>
|
||||
</field>
|
||||
<!-- Display the real field names of the search -->
|
||||
|
||||
<!-- We split the search of name, ref / email in two
|
||||
as searching in email can return a lot of unwanted result
|
||||
for exemple when you sell on marketplace and search for a customer
|
||||
amazon you will have all customer that have bought throught the marketplace -->
|
||||
|
||||
<field name="name" position="attributes">
|
||||
<attribute name="string">Name, Ref, Email</attribute>
|
||||
<attribute name="string">Name, Ref</attribute>
|
||||
<attribute name="filter_domain">['|', ('display_name','ilike',self), ('ref','=',self)]</attribute>
|
||||
</field>
|
||||
<field name="name" position="after">
|
||||
<field name="email"/>
|
||||
</field>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import models
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
"bin": [],
|
||||
},
|
||||
"depends": [
|
||||
"attribute_usability",
|
||||
"product_variant_inactive",
|
||||
],
|
||||
"data": [
|
||||
"views/product_view.xml",
|
||||
"views/product_attribute_view.xml",
|
||||
],
|
||||
"demo": [
|
||||
],
|
||||
|
||||
3
product_variant_usability/models/__init__.py
Normal file
3
product_variant_usability/models/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import product
|
||||
16
product_variant_usability/models/product.py
Normal file
16
product_variant_usability/models/product.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Akretion (http://www.akretion.com).
|
||||
# @author Sébastien BEAU <sebastien.beau@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import fields, models
|
||||
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
all_product_variant_ids = fields.One2many(
|
||||
'product.product',
|
||||
'product_tmpl_id',
|
||||
'All Product Variant',
|
||||
domain=['|', ('active', '=', False), ('active', '=', True)])
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="product_attribute_view_form" model="ir.ui.view">
|
||||
<field name="model">product.attribute</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Product Attribute">
|
||||
<sheet>
|
||||
<div class="oe_title" style="width: 390px;">
|
||||
<label class="oe_edit_only" for="name" string="Product Name"/>
|
||||
<h1><field name="name" class="oe_inline"/></h1>
|
||||
</div>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="value_ids" colspan="4" nolabel="1">
|
||||
<tree editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="comment"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="attribute_tree_view" model="ir.ui.view">
|
||||
<field name="model">product.attribute</field>
|
||||
<field name="inherit_id" ref="product.attribute_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree" position="attributes">
|
||||
<attribute name="editable"></attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product.attribute_action" model="ir.actions.act_window">
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<record id="product_template_view_form" model="ir.ui.view">
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
||||
<field name="priority" eval="64"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="attribute_line_ids" position="after">
|
||||
<field name="product_variant_ids" nolabel="1" domain="['|', ('active', '=', False), ('active', '=', True)]" required="0">
|
||||
<field name="all_product_variant_ids" nolabel="1" required="0">
|
||||
<tree create="0">
|
||||
<field name="default_code"/>
|
||||
<field name="attribute_value_ids" widget="many2many_tags"/>
|
||||
@@ -20,7 +20,7 @@
|
||||
icon="gtk-stop"/>
|
||||
<button type="object"
|
||||
name="button_deactivate"
|
||||
attrs="{'invisible': [('active','=',False)]}"
|
||||
attrs="{'invisible': [('active','=',False)]}"
|
||||
icon="gtk-apply"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
1
stock_split_menu/__init__.py
Normal file
1
stock_split_menu/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
30
stock_split_menu/__openerp__.py
Normal file
30
stock_split_menu/__openerp__.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Akretion (http://www.akretion.com).
|
||||
# @author Sébastien BEAU <sebastien.beau@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Stock Split Menu",
|
||||
"summary": "Split the receive, internal move, ship menu",
|
||||
"version": "8.0.1.0.0",
|
||||
"category": "Warehouse",
|
||||
"website": "www.akretion.com",
|
||||
"author": " Akretion",
|
||||
"license": "AGPL-3",
|
||||
"application": False,
|
||||
"installable": True,
|
||||
"external_dependencies": {
|
||||
"python": [],
|
||||
"bin": [],
|
||||
},
|
||||
"depends": [
|
||||
"stock",
|
||||
],
|
||||
"data": [
|
||||
"view/stock_view.xml",
|
||||
],
|
||||
"demo": [
|
||||
],
|
||||
"qweb": [
|
||||
]
|
||||
}
|
||||
48
stock_split_menu/view/stock_view.xml
Normal file
48
stock_split_menu/view/stock_view.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="action_picking_out_tree" model="ir.actions.act_window">
|
||||
<field name="name">Livraisons</field>
|
||||
<field name="res_model">stock.picking</field>
|
||||
<field name="domain">[('picking_type_code', '=', 'outgoing')]</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'type': 'outgoing', 'search_default_available': 1, 'search_default_waiting': 1}</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
action="action_picking_out_tree"
|
||||
id="menu_picking_out_tree"
|
||||
parent="stock.menu_stock_warehouse_mgmt"
|
||||
sequence="10"/>
|
||||
|
||||
<record id="action_picking_internal_tree" model="ir.actions.act_window">
|
||||
<field name="name">Mouvements internes</field>
|
||||
<field name="res_model">stock.picking</field>
|
||||
<field name="domain">[('picking_type_code', '=', 'internal')]</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'type': 'internal', 'search_default_available': 1, 'search_default_waiting': 1}</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
action="action_picking_internal_tree"
|
||||
id="menu_picking_internal_tree"
|
||||
parent="stock.menu_stock_warehouse_mgmt"
|
||||
sequence="20"/>
|
||||
|
||||
<record id="action_picking_in_tree" model="ir.actions.act_window">
|
||||
<field name="name">Réceptions</field>
|
||||
<field name="res_model">stock.picking</field>
|
||||
<field name="domain">[('picking_type_code', '=', 'incoming')]</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'type': 'incomming', 'search_default_available': 1, 'search_default_waiting': 1}</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
action="action_picking_in_tree"
|
||||
id="menu_picking_in_tree"
|
||||
parent="stock.menu_stock_warehouse_mgmt"
|
||||
sequence="30"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user